mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-01 10:13:35 +00:00
Compare commits
727 Commits
IPMITOOL_1
...
IPMITOOL_1
Author | SHA1 | Date | |
---|---|---|---|
cf3d23213c | |||
ad86adac54 | |||
f04ccaf79e | |||
fa74f3bf3a | |||
8e95964938 | |||
558bf55c41 | |||
393ae97425 | |||
ee6c9be382 | |||
5177966867 | |||
f6dbaf231b | |||
8cd3acb188 | |||
2c6ca03f8a | |||
aebc7d3616 | |||
157132be8c | |||
8525fdd2a3 | |||
f8cecaa71a | |||
a771107c47 | |||
afd015709b | |||
bfba2f83f5 | |||
8e94374cf1 | |||
ced5794e48 | |||
a298d2e704 | |||
2d71d428f3 | |||
2e5fbc878b | |||
8b7969a46f | |||
04ba23bc5d | |||
977c587fde | |||
dd377108ee | |||
4aea72e46f | |||
39bcb37d14 | |||
7770739372 | |||
2ac947f6e1 | |||
c94c7a5c86 | |||
4fdbe5bbd0 | |||
c49bc06c39 | |||
55524327ce | |||
85ff7dc46a | |||
8c5013b0ba | |||
ea8ce15131 | |||
6d89531096 | |||
e56e914866 | |||
cee8fc659a | |||
25fa0f80ae | |||
22e38bc46f | |||
3bd53a2f78 | |||
30e4efe8a4 | |||
bf8acad458 | |||
2db7f5f6b9 | |||
71dea69efc | |||
9f51d8f188 | |||
8a40297308 | |||
fb5d8559e6 | |||
2a260d32e9 | |||
94c0bd0a6c | |||
3cb937f15e | |||
edc700ed9a | |||
287b313e26 | |||
47d53000ce | |||
66399810f0 | |||
0ab78dbf02 | |||
c048c9f311 | |||
c32228d7c1 | |||
a855c37619 | |||
6a66405177 | |||
4a4331ef6d | |||
41288eb5e4 | |||
dbd2db71f2 | |||
a472c382f4 | |||
e8125c2405 | |||
c0f41fa647 | |||
5c74d2935e | |||
cd6b7039f0 | |||
b4cb02a4d9 | |||
91fdb17260 | |||
2302e83db5 | |||
b0294b96fd | |||
f1f2cbb18b | |||
eb65a625a2 | |||
516fe51505 | |||
5d5251f7da | |||
5819b314af | |||
630934cb89 | |||
d44be6e5f5 | |||
078ff3a04e | |||
865c435b4c | |||
1d9dd4e2de | |||
e95a4cf998 | |||
38f89a449d | |||
64e0b9ab64 | |||
e30f3726a6 | |||
63ba1cc610 | |||
384618d1bc | |||
b0020e0bae | |||
7a861ffba6 | |||
811da1307a | |||
8489426a63 | |||
dbe514a558 | |||
d5ab51f2cd | |||
0cea01e42f | |||
38d71179e9 | |||
cc48c433fd | |||
51dd9cf1f0 | |||
44247a8743 | |||
d82a29d813 | |||
c5324e879c | |||
a8f6341728 | |||
7472986e1c | |||
72dd3edde4 | |||
cf6740b3f6 | |||
14e26ac8a0 | |||
cee211da31 | |||
3818c0d296 | |||
ae05861b62 | |||
c29cf4bcd3 | |||
723e3da037 | |||
c72afa37ee | |||
fa5bdb2f3d | |||
49784a9ec8 | |||
d1d404fef4 | |||
de1dee44bd | |||
e1728327f6 | |||
3b77db9a86 | |||
2abad0e504 | |||
0411186443 | |||
1e96d20277 | |||
de4de4fc96 | |||
4299cfa385 | |||
184994586e | |||
692861f292 | |||
39408ea589 | |||
1602e0a7a2 | |||
f074f76620 | |||
87e6c7279d | |||
1f1dc806fe | |||
8afb3c315b | |||
4aae41904d | |||
41a44b037f | |||
49a7ceee70 | |||
3687a6cbb8 | |||
627cadaa39 | |||
eb63058bc3 | |||
15f1255237 | |||
2dfa02ba24 | |||
9d6a201911 | |||
ad01921281 | |||
d27d2f7ae3 | |||
26c17eeb91 | |||
fdbef84866 | |||
3a383608dd | |||
66fcf484a4 | |||
52c07d61f9 | |||
fd752420ec | |||
7a74ab32a8 | |||
3ea41bda4b | |||
992b42ceee | |||
002c8becf4 | |||
6f1bd51f1e | |||
4719d371b7 | |||
ba9a313911 | |||
4a9af33734 | |||
e320e266b1 | |||
95df7b2499 | |||
665f2f7ee9 | |||
e99e525a53 | |||
39ad0d62cc | |||
db56cc3f86 | |||
108dc8aa0b | |||
b6c97d8318 | |||
fd2ab0b7bb | |||
8c91abfa19 | |||
4c009309eb | |||
ed1865da0a | |||
c726a09482 | |||
a70de993cf | |||
c53a3cbb8e | |||
69e43dc87f | |||
5fa202f7d3 | |||
c070fc00d6 | |||
bd4f34b035 | |||
6e87e423eb | |||
37861d60e4 | |||
bd5ffa4756 | |||
c958de2870 | |||
86805c2146 | |||
c97d9d5b85 | |||
76ed820e03 | |||
091ba2ea58 | |||
3f53760062 | |||
83794843b5 | |||
4a12bdebd6 | |||
8a4139e1b8 | |||
15d683d86d | |||
6eda3b5482 | |||
6a82e95988 | |||
28f93df807 | |||
3f9b728e57 | |||
9a8a8b7dad | |||
75d6c72c5d | |||
8882955891 | |||
22b283b210 | |||
2bb3100395 | |||
5dbb6b69de | |||
791268a61c | |||
970c5ff8b6 | |||
4728863d5b | |||
a3d872c73d | |||
9b3000e329 | |||
bd851bab8f | |||
b4754b5edb | |||
99e4ac0399 | |||
6733b66a9c | |||
daf4c4831f | |||
d2d2f4789d | |||
cce3f84896 | |||
3018b229b1 | |||
fc62075b76 | |||
a5384fa12e | |||
7973f44304 | |||
8d9b434b5a | |||
5b90f68407 | |||
2edc474cef | |||
472d8ab1b3 | |||
4af83567b0 | |||
66bdb86f04 | |||
9ef6162f3c | |||
629a96d9c3 | |||
122e11a2e8 | |||
a974ab2c69 | |||
f8f6d51fd2 | |||
8d828f6c72 | |||
d54e20c545 | |||
44310bd898 | |||
a9f7a7b92e | |||
d65cccc32a | |||
131846fb40 | |||
c62359bd79 | |||
1e83f7c88a | |||
4a4b2e3b59 | |||
c88b139452 | |||
6011359cb3 | |||
23a5477d6e | |||
700ee7d27d | |||
2d725c2cd6 | |||
5c9addb8c4 | |||
c0290ef09a | |||
6c1e3e2ecc | |||
77d9e49290 | |||
0d62e6f6e0 | |||
f0f9e187c9 | |||
89037b5158 | |||
342e71d577 | |||
e196d85e43 | |||
7528b89b36 | |||
e07a644672 | |||
fbb778c469 | |||
fdc403302d | |||
3f712fe2fc | |||
3631bd877c | |||
0ef4c3e254 | |||
5d960089c9 | |||
31cb04f155 | |||
7289f70ec9 | |||
4b058899a2 | |||
79fdc68950 | |||
6a18254c9d | |||
2dfaeac27d | |||
aab226da28 | |||
180aaaabbf | |||
bf9406249a | |||
56828dbaf7 | |||
219f67e41a | |||
62df3e6ea8 | |||
f1fced7ec8 | |||
75a7ebf5c7 | |||
53df70235f | |||
8ed8ace59d | |||
c08bded0f3 | |||
90d40c6d7a | |||
7733416d2b | |||
5f11bb25b0 | |||
8de0428bdc | |||
f907245d39 | |||
fbd0c88ae6 | |||
373e4fe28d | |||
fdf1176fa0 | |||
062bd1f9a4 | |||
6e5043f289 | |||
83b34749c5 | |||
403c86e51c | |||
89759cbdec | |||
89243c2929 | |||
9d8aa74a54 | |||
ad4065a370 | |||
e230427138 | |||
4a462cd714 | |||
29d82210b4 | |||
adbdafb535 | |||
8a6343ff0d | |||
a1dcd5790a | |||
a2485a3b5e | |||
bb632de830 | |||
78d7ae8d88 | |||
904cbebce5 | |||
09fc12a929 | |||
2902784cf3 | |||
a9b78ab736 | |||
3d5e378e90 | |||
d4c2577a16 | |||
f681fe89b7 | |||
ca062647be | |||
3423c1d92f | |||
e0b75fba8c | |||
7dd969f2c6 | |||
a9c68c76c3 | |||
e29166e4e8 | |||
9217312cc4 | |||
fbf75dd075 | |||
bf1e9952e1 | |||
5ed7f6ac0a | |||
b6d2f7e302 | |||
bb40822d34 | |||
835fe8886c | |||
55ee48696a | |||
fedd6f187f | |||
a6cad674d0 | |||
c1e46b35cd | |||
a65d5add66 | |||
ba6f2fe2a2 | |||
ebab3919ef | |||
e6db6a04b5 | |||
fb75f8d8fc | |||
9660e90ad2 | |||
e0ed4351d0 | |||
619233e14b | |||
7c9baca424 | |||
c9b53b1b32 | |||
54cc84adf2 | |||
37d672412d | |||
1b1efca7e2 | |||
c9bd5b5b90 | |||
19295a5483 | |||
d06ddcd28b | |||
335d444213 | |||
0cbc38746a | |||
348cd98287 | |||
eb22beb537 | |||
019a9de626 | |||
c5c6315525 | |||
7fc4ce6eae | |||
061272f595 | |||
fab9a60f71 | |||
3e2211dc47 | |||
f798f74234 | |||
74e2376bf9 | |||
2f1773a819 | |||
9ab06ee09e | |||
94e47fb2c6 | |||
13bb060366 | |||
fdf49777b9 | |||
2a180f8038 | |||
799a0846c2 | |||
60b62d4f34 | |||
31bee2ebff | |||
5e0e128eb3 | |||
d9e5ff1878 | |||
9f52686526 | |||
801e6f1136 | |||
b97d1b74e2 | |||
c0e63cefbb | |||
cad476e5b1 | |||
fe43278196 | |||
c3b8410fcc | |||
58e82be3c4 | |||
cf63a9d593 | |||
5348236e65 | |||
c4ece9a1eb | |||
92cb687630 | |||
362bb42cf8 | |||
4b230f13d7 | |||
e1c25a988f | |||
2902422eeb | |||
ca0932532a | |||
ea105cd83b | |||
c098938a4b | |||
235f475e60 | |||
023a2797b8 | |||
050055e8f0 | |||
9a1a15d134 | |||
9b56a57890 | |||
ab48fc0f55 | |||
6878547f27 | |||
57dc49803e | |||
0762cdd324 | |||
cf3dd06818 | |||
0dfd0d494a | |||
e41a6aacb3 | |||
50c514e336 | |||
021728965c | |||
fae2b40020 | |||
b78f1194c9 | |||
3083c1dd7a | |||
6f0ecadabd | |||
ebb60eebee | |||
a3dd05510a | |||
ba83ecd7d3 | |||
b23f858ee3 | |||
fb0d4e7fc1 | |||
a0673a77b3 | |||
6d4fccf922 | |||
c30f036391 | |||
72d66edc6c | |||
8582569149 | |||
7cc935f2f1 | |||
461ade4994 | |||
09adafacd8 | |||
0ea2ba5f14 | |||
b5fb1221c1 | |||
92a2b12fe1 | |||
a9c626e67e | |||
9e1bf929c2 | |||
dece10b9d6 | |||
ebce6517f5 | |||
ccb0aba6b9 | |||
0f1e92a450 | |||
b1ffd29ee6 | |||
e2b72d82de | |||
756c22a866 | |||
1f0bbcd8dd | |||
afbec90dc2 | |||
96df77742c | |||
956b421ef8 | |||
e427ed4423 | |||
6c02a74a31 | |||
b16dc1bf5a | |||
3268e0d9c1 | |||
79ed9ec34e | |||
2579bbe542 | |||
1d927c8c45 | |||
37cb538e5a | |||
025f196aec | |||
928da786e5 | |||
10f4a1a5c5 | |||
ca90a4b48b | |||
c5d1894531 | |||
90244733b4 | |||
4787c3de81 | |||
8680d3dc4e | |||
be5db2df38 | |||
63eaecf469 | |||
b7ae2149e9 | |||
e807543023 | |||
a1684a2e0b | |||
e31ba93a23 | |||
653c9b20d5 | |||
e3abbf667a | |||
7924e052ca | |||
264b95cd21 | |||
f8b3d70c13 | |||
b1cef77bcf | |||
3b08cc6002 | |||
1593341ed7 | |||
35daac42a5 | |||
5b8255f671 | |||
abf77904a0 | |||
cceb1ff803 | |||
c81563434b | |||
185b23a5c4 | |||
6377070275 | |||
77740c39cc | |||
2acce3766c | |||
86eef09b2f | |||
09011bb590 | |||
03c5c6a639 | |||
52dc545d2e | |||
4ef4e3c298 | |||
b120e11c3d | |||
d09e279c79 | |||
1eda5611dd | |||
9689fe6199 | |||
34dd10feda | |||
c344f2ffe0 | |||
c23b875c8b | |||
d0155c3917 | |||
a2e7888156 | |||
a724a38c42 | |||
72831c6d22 | |||
1e8967b1f9 | |||
bf815d0093 | |||
c3aefda148 | |||
1c784e80ec | |||
2793990a94 | |||
1d3a7ff50a | |||
b3d5558a40 | |||
5cf45e711e | |||
3c94523f11 | |||
b3563716bd | |||
1aeaa97475 | |||
4dcfe6d6c8 | |||
3be848a82a | |||
513dabb395 | |||
6a269e5741 | |||
d9e561a4cf | |||
6e4a63bdfe | |||
8aad659697 | |||
c306d08d7e | |||
0b9f0d6a35 | |||
e6f0e459dd | |||
5e455132c1 | |||
107257210d | |||
a654ca2683 | |||
431421c6ff | |||
027fc1139c | |||
7e9cd85e8d | |||
e8ad5be7fb | |||
86c4e40277 | |||
b0c04f8577 | |||
8824e41b48 | |||
270a50c8c5 | |||
8df490955c | |||
de63f9a9d5 | |||
170c14560c | |||
d3badb58b2 | |||
db735bf685 | |||
7959b894b4 | |||
71a6dde3f8 | |||
8954fe454b | |||
56adf15b23 | |||
ab18a0e335 | |||
997ca1fa4d | |||
b06f6bdbb5 | |||
798228cb72 | |||
a022f1e792 | |||
a6e1840e4f | |||
86364dec74 | |||
61318c0158 | |||
14004d0749 | |||
ec9cddc21a | |||
cedb32d569 | |||
9a508d1f19 | |||
f6cb3516b3 | |||
fa7a690e26 | |||
5f018c9516 | |||
664848112e | |||
a703e41949 | |||
3938d15098 | |||
76bb61de6c | |||
0faade4b8a | |||
4e39200eff | |||
a4676f7b6e | |||
3b384a306f | |||
0fcf7acdba | |||
d04f496c7a | |||
a263209bb6 | |||
d824af51a9 | |||
e655394a7a | |||
07c3456330 | |||
80b8d3b318 | |||
ed84ac0a9b | |||
fa7d4b3ec7 | |||
f34245e46e | |||
f8bc5ae591 | |||
b3d5150acd | |||
2faf5857c8 | |||
f4a6a73184 | |||
94865441a1 | |||
32fbd909b2 | |||
568e75e147 | |||
2e7571daf2 | |||
c13966f04b | |||
56b892cea1 | |||
bec24b9019 | |||
45185b23ec | |||
ecca25ed2b | |||
eccd10200f | |||
0bad3feabd | |||
edb0ba9c6d | |||
c4a368edfb | |||
b136863199 | |||
628c3ca854 | |||
0a682dbedd | |||
b3dde472ce | |||
22f0fc7c00 | |||
6eaa2e8305 | |||
992b36bc0f | |||
6a68dc2e65 | |||
66958d8c52 | |||
333dc5bedc | |||
a62287c589 | |||
43a529bff0 | |||
cf96efd47d | |||
9cbe0938f1 | |||
7acd1310ec | |||
77b47d3751 | |||
9a4979ac62 | |||
9e4bbc2e65 | |||
8fc8e1a69a | |||
18b6d4cc08 | |||
a74e7d396a | |||
88af9d3652 | |||
968e97d905 | |||
459770d58c | |||
c28da79cab | |||
b548d3573b | |||
68afc1b001 | |||
c78911c730 | |||
6ac87eed90 | |||
9f66ac2cd3 | |||
3bd95062ba | |||
86a32205be | |||
583a5e7cd0 | |||
381783786a | |||
cea777a51d | |||
e3c97ddd3d | |||
e7f7209c32 | |||
5d21a9d8a8 | |||
74e028690b | |||
fda2c028fe | |||
19f9d13807 | |||
9fcde40c97 | |||
34b21d2d57 | |||
9e14d37835 | |||
981a24365f | |||
729bf0e7c3 | |||
db4a2e5951 | |||
ef20239926 | |||
e672819a9d | |||
f61c3acbaf | |||
eab4dfe679 | |||
89199b49f3 | |||
96dec6ddc7 | |||
153965aca2 | |||
4e79265a7c | |||
1c60cbf500 | |||
b82cfdf945 | |||
09a6e0e917 | |||
760de11c71 | |||
50f36dd841 | |||
0d6fecc737 | |||
ab58809b3b | |||
d572add750 | |||
fa21266ec2 | |||
f63189780f | |||
7849cc978f | |||
6013cec710 | |||
9f6133936d | |||
580f416693 | |||
c99e8595e4 | |||
a92765fbc9 | |||
cc63758d53 | |||
388b9e058d | |||
520aa05c07 | |||
533582e9e3 | |||
c3289bb6f4 | |||
b3d2bb937d | |||
070f36d1ae | |||
882d9ce81c | |||
d0e5434790 | |||
4ab522ab29 | |||
ce3636894d | |||
83a924d7ed | |||
28a7f2c14b | |||
10154ba9ce | |||
12a6554416 | |||
78f8f0793f | |||
4433696ae4 | |||
c9b2eb04f6 | |||
be79973194 | |||
8e12bc0299 | |||
b253fd5da3 | |||
811c894d78 | |||
65d1b0a623 | |||
e667785bd3 | |||
cf74129ba8 | |||
3a30f4d0b8 | |||
ac40435a4a | |||
b800400c41 | |||
9132b30b6c | |||
dd29a141ed | |||
9f86c0601a | |||
f7cfe44ce7 | |||
1ad5d3d0b2 | |||
9b4766a767 | |||
a43c37e6ce | |||
ee044f0169 | |||
a089b441f9 | |||
adef82354e | |||
ee59c4d0f1 | |||
9fd9b29cb5 | |||
35a7fad915 | |||
905892b5a7 | |||
8fd02275a0 | |||
133cf86058 | |||
7467b928c1 | |||
cfd5783232 | |||
c44a3a85f6 | |||
7e029dbb87 | |||
e3be943843 | |||
4b1ccbfdc3 | |||
e37e785449 | |||
66ffa994e9 | |||
21fb127ce2 | |||
c65b206144 | |||
a3d206523d | |||
06ad21054f | |||
e2cc94d96b | |||
56c495455c | |||
64af2f2bdb | |||
d80fa31411 | |||
271c681609 | |||
fa8c8116e1 | |||
5532b6856e | |||
58ea8803f9 | |||
99070e730e | |||
115df86f23 | |||
a94f0e612c | |||
e21475c78d | |||
6f3e247274 | |||
b8d9ada302 | |||
29dbaf6882 | |||
f367905bef | |||
66cb3143dc | |||
79befbb112 | |||
185b762fa9 | |||
5d7197d467 | |||
b0498d93cf | |||
9f49913c2f | |||
73d088de1f |
@ -28,6 +28,3 @@ PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
You acknowledge that this software is not designed or intended for use
|
||||
in the design, construction, operation or maintenance of any nuclear
|
||||
facility.
|
||||
|
@ -1,3 +1,491 @@
|
||||
version 1.8.13rc0 2013-08-09
|
||||
* ID: 3611905 - Direct Serial Basic/Terminal Mode Interface drivers
|
||||
* ID: 3577766 - configure's knobs and switches don't work
|
||||
* ID: 3611253 - do not override OS-default values for interfaces
|
||||
* ID: 65 - Fixes for configure.in for cross compilation
|
||||
* ID: 3571153 - OpenIPMI/ipmievd fails to compile on Solaris
|
||||
* numerous ipmitool man page updates
|
||||
* ID: 3611226 - Bridging support for PICMG Platforms
|
||||
* Add support for getsysinfo/setsysinfo commands to ipmi mc
|
||||
* Cleanup Dell OEM code to use new sysinfo interface
|
||||
* ID: 93 - str-to-int conversion is weak
|
||||
* ID: 3582307 - ipmi_fru - ipmi_fru_main() return codes
|
||||
* ID: 3582310 - ipmi_fru - ipmi_fru_main() - misuse of printf()
|
||||
* ID: 3576213 - ipmi_fru - unused variable
|
||||
* ID: 3578276 - ipmi_fru - free() on freed memory possible
|
||||
* ID: 3578275 - ipmi_fru - memory leaks
|
||||
* ID: 3528271 - ipmi_fru - possible *flow via FRUID
|
||||
* ID: 3578277 - ipmi_fru - possible NULL pointer
|
||||
* ID: 3612372 - Recognize Broadcom IANA number and BCM5725 product
|
||||
* ID: 3608758 - add IPMI_NETFN_OEM
|
||||
* ID: 143 - Reversed 'channel authcap' capabilities
|
||||
Fixes reversed IPMIv1.5/2.0 'channel authcap' capabilities
|
||||
* ID: 3587318 - "dcmi discover" is not DCMI 1.5 compatible
|
||||
* ID: 3608757 - ipmi_fru - various fixes
|
||||
* ID: 3598203 - 'mc getsysinfo|setsysinfo' needs a bit of re-work
|
||||
* ID: 3597782 - ipmi_mc - sysinfo_param() has two consecutive returns
|
||||
* ID: 3597781 - 'mc getsysinfo|setsysinfo' help has typos
|
||||
* ID: 3608763 - ipmi_sdr - code cleanup & output display cleanup
|
||||
* ID: 3610286 - ipmi_sdr - ipmi_sdr_print_type - incorrect eval
|
||||
* ID: 3600930 - ipmi_sdr - code cleanup
|
||||
* ID: 3602439 - ipmi_sdr - memory leaks
|
||||
* ID: 3595199 - ipmi_sdr - Add support for 'ipmitool sdr <list|elist> help'
|
||||
* ID: 3592773 - 'ipmitool sdr info'; prints incorrect info
|
||||
* ID: 3592770 - 'ipmitool sdr list|elist INV_INPUT' return code
|
||||
* ID: 3577159 - ipmi_sdr - uint32_t cast to uint8_t and back
|
||||
* ID: 3528368 - ipmi_sdr - possible int *flow
|
||||
* ID: 226 - ipmi_sdradd - typo
|
||||
* ID: 258 - ipmi_sdradd - error printed on STDOUT
|
||||
* Fixed ipmievd start under systemd.
|
||||
* ID: 3608760 - Add bswap.h to ipmi_chassis.c and ipmi_pef.c
|
||||
* ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures
|
||||
* ID: 3600907 - defined value for "Chassis may not support Force Identify"
|
||||
* ID: 256 - ipmitool could crash when IPv6 address is returned
|
||||
* ID: 211 - 'lib/ipmi_dcmi.c' - typo & error printed on STDOUT
|
||||
* ID: 3612237 - If DCMI command fails, incorrect completion code is printed
|
||||
* ID: 3608149 - ipmitool - set pointer to NULL after free()
|
||||
* ID: 3603419 - DCMI - waste of resources
|
||||
* ID: 3600908 - DMCI - crash in ipmi_print_sensor_info(), NULL ref
|
||||
* ID: 3609985 - delloem : Wrong MAC returned when flex addressing is enabled
|
||||
* ID: 113 - delloem exec file won't handle more than one command
|
||||
* ID: 28 - delloem - clean up the code
|
||||
* ID: 3608261 - delloem - code formatting
|
||||
* ID: 3528247 - delloem - fix possible *int flows
|
||||
* ID: 3600910 - delloem - code cleanup
|
||||
* ID: 3576211 - delloem - unused variable
|
||||
* ID: 3578022 - delloem - fix typos
|
||||
* ID: 263 - ipmi_ek* - cleanup
|
||||
* ID: 3308765 - ipmi_ek* - cleanup
|
||||
* ID: 3586228 - ipmi_ek* - ipmi_ekanalyzer_usage() rework
|
||||
* ID: 3528388 - ipmi_ek* - a typo in error message
|
||||
* ID: 3576212 - ipmi_event - better rsp handling
|
||||
* ID: 3607393 - ipmi_event - redundant '\n' in error message
|
||||
* ID: 153 - ipmi_firewall - printf() used instead of lprintf()
|
||||
* ID: 3608003 - ipmi_fru - atol() should be replaced with str2*()
|
||||
* ID: 3600911 - ipmi_fru - fix multiple increments in args to printf
|
||||
* ID: 3600914 - no more crash on no response. allow more send/recv loops of waiting.
|
||||
* ID: 70 - Fixes and updates for ipmitool hpm
|
||||
* ID: 3528308 - ipmi_hpmfwupg - possible int *flow
|
||||
* ID: 3608762 - ipmi_hpmfwup - Fixed help messages for hpm command
|
||||
* ID: 3607981 - ipmi_lanp - replace atoi() calls
|
||||
* ID: 3607320 - ipmi_lanp - possible NULL reference
|
||||
* ID: 3600926 - ipmi_lanp - code cleanup
|
||||
* ID: 3613575 - memory leak - ipmi_password_file_read()
|
||||
* ID: 3522740 - reading password from file is limited to 16byte passwords
|
||||
* ID: 3613605 - ipmi_main - call free() on pointer to static data
|
||||
* ID: 3608761 - ipmi_main - PICMG Get Device Locator was never run
|
||||
* ID: 3577155 - ipmi_main' - memory leaks
|
||||
* ID: 239 - typo in 'mc selftest', add details
|
||||
* ID: 3597471 - ipmi_mc - needs a bit of re-work - rc, inv. options
|
||||
* ID: 3597468 - ipmi_mc - print_mc_usage() prints to STDOUT
|
||||
* ID: 3597469 - 'mc watchdog off' prints on STDERR, should be STDOUT
|
||||
* ID: 3597470 - 'mc watchdog reset' prints on STDERR, should be STDOUT
|
||||
* ID: 3611254 - OEM handle for Intel 82751 in SPT mode
|
||||
* ID: 3600927 - change eval order of input param in ipmi_oem_setup()
|
||||
* ID: 3600928 - ipmi_pef - code cleanup
|
||||
* ID: 3592732 - ipmi_picmg.c - printf() misuse
|
||||
* ID: 3528310 - ipmi_picmg.c - NULL reference
|
||||
* ID: 3528347 - ipmi_raw.c - possible int *flow
|
||||
* ID: 3587913 - Command % ipmitool raw help; returns 1
|
||||
* Added code to support sensors on other luns (On behalf of Kontron Germany)
|
||||
* ID: 3611912 - Add missing newlines when cvs output is specified
|
||||
* ID: 244 - ipmi_sel - "0.0" displayed for unspecified threshold values
|
||||
* ID: 3612371 - Typo in impi_sel debug output
|
||||
* ID: 3016359 - ipmi_sel - Get SEL Alloc Information is incorrect
|
||||
* ID: 3568976 - 'sel set time' behaviour is inconsistent
|
||||
* ID: 3528371 - ipmi_sensor - possible int *flow
|
||||
* ID: 3601265 - 'ipmitool sensor get' leaks memory
|
||||
* ID: 3601106 - 'ipmitool sensor get NACname' output incorrect/inconsistent
|
||||
* ID: 3608007 - ipmi_session - typo in error message
|
||||
* ID: 101 - ipmi_sol - possible int *flow
|
||||
* ID: 3600933 - ipmi_sol - use of deprecated bzero()
|
||||
* ID: 3609472 - ipmi_sol - Add the instance to the SOL commands
|
||||
* ID: 3588726 - 'ipmitool sol payload status ...;'segfaults on no rsp
|
||||
* ID: 3522731 - ipmi_sol - ipmi_get_sol_info() returns always 0
|
||||
* ID: 3613042 - add missing Entity IDs
|
||||
* ID: 3611306 - ipmi_tsol - fix always fail in case of error
|
||||
* ID: 259 - ipmi_user - memory leak
|
||||
* ID: 260 - ipmi_user - replace atoi() call
|
||||
* ID: 2871903 - ipmitool user priv incorrectly sets Link Auth
|
||||
* ID: 3600960 - check the copy of password exists
|
||||
* ID: 3609473 - Add assertion/deassertion to threshold events
|
||||
* ID: 104 - ipmishell - possible int *flow
|
||||
* ID: 262 - 'set' segfaults when no IPMI inf present
|
||||
* ID: 257 ipmitool exec segfaults if invalid input given
|
||||
* ID: 254 - Fix retry of authentication capabilities retrieval
|
||||
* ID: 3611303 - lan - error check is missing braces
|
||||
* ID: 253 - Fix lanplus retransmission
|
||||
* ID: 212 - 'lib/ipmi_dcmi.c' - possible int *flow
|
||||
* ID: 264 - incorrect array index in get_lan_param_select()
|
||||
* ID: 269 - Fixes for configure.in for cross compilation
|
||||
* ID: 267 - Corruption in "lan alert print" output
|
||||
* ID: 41 - ipmi_sel_interpret() - clean up formatting, indentation
|
||||
* ID: 242 - Incorrect DCMI Power Reading "IPMI timestamp" interpretation
|
||||
* ID: 229 - 'lib/ipmi_ekanalyzer.c' - a typo ``Too few argument!''
|
||||
* ID: 266 - file descriptor leak in ipmi_fwum and ipmi_ekanalyzer
|
||||
* ID: 99 - 'lib/ipmi_sel.c' - possible int *flow
|
||||
* ID: 222 - 'lib/ipmi_sdr.c' - a typo 'Not Reading' -> 'No Reading'
|
||||
* ID: 35 - Script to setup redirection of SNMP to/from BMC
|
||||
|
||||
|
||||
version 1.8.12 released 2012-08-09
|
||||
* Added IPMB dual bridge support (no need for driver support)
|
||||
* Enable compiler warnings and resolve all compiler warning so that
|
||||
ipmitool compiles and links with no warning or error messages
|
||||
* add ipmishell line to configure
|
||||
* fail configure when no curses or readline is found
|
||||
* support sensor bridging in free interface
|
||||
* applied fix for issue #2865160 (AIX build)
|
||||
* Document the ipmitool dcmi commands in the ipmitool man page
|
||||
* Document that some commands are blocked by OpenIPMI. ID 2962306
|
||||
* Document the -N and -R options per tracker ID 3489643
|
||||
* fix manpage misdocumentation on cipher suite privilige configuration
|
||||
* Add build support for Dell OEM commands
|
||||
* Add new Dell OEM commands and update man page
|
||||
* added hpm and fwum in man page
|
||||
* man page update for fwum and hpm commands
|
||||
* Added documentation for 'ime' operating mode, used to update Intel ME.
|
||||
* add new -Y option to prompt user to enter kgkey
|
||||
* Add DCMI module (Data Center Management Interface)
|
||||
* fixed oem/iana data type to allow 24 bits definition
|
||||
* Fixed AMC point-to-point record parsing in FRU
|
||||
* Fixed detection of packing support in GCC
|
||||
* Added packing support detection magic on all packed structures
|
||||
in project
|
||||
* Dell specific mac sub command is updated to support the latest 12G
|
||||
Dell servers. Support for virtual mac is also implemented.
|
||||
* Use consistent netfn/cmd for getsysinfo command
|
||||
* Add Dell OEM network commands
|
||||
* Resolve incorect Board Mfg Data due to incorrect date constant
|
||||
* Update ipmi_fru.h to SMBIOS spec 2.6.1 - ID 2916398
|
||||
* Support for analog readings in discrete sensors on HP platforms.
|
||||
* Change device id mask (IPM_DEV_DEVICE_ID_REV_MASK) 0x07 for 0x0F.
|
||||
As per in IPMI spec V2:
|
||||
* Added PICMG clock e-keying and bused resource control identifiers
|
||||
* Added PICMG major version (ATCA/AMC/uTCA) identifiers
|
||||
* Correct Threshold/Discrete Sensor Display - Patch Tracker ID 3508759
|
||||
* Sensor units now handle percentage units - ID 3014014
|
||||
* Fixes ID 3421347 Sensor list command should use channel field from SDR
|
||||
* Added packing directive for ARM cross compile with GCC 3.4.5,
|
||||
otherwise the sdr structures gets padded and the pointer cast
|
||||
result in incorrect alignement
|
||||
* Added 'sdr fill sensors nosats' support to speed up SDR discovery
|
||||
* Added SDR name display during discovery (with -v)
|
||||
* Added support for sensor types - Processor related sensor
|
||||
type 0x07, system incharectorization 0x20, Memory sensor type.
|
||||
* Give more description for SEL which is generated for Uncorrectable
|
||||
ECC and errors with respect to each Memory Bank,Card or DIMM.
|
||||
The Sensor type supporting this are 0x0C and 0x10.
|
||||
* Add more details about Version Change event (source of
|
||||
firmware update)
|
||||
* enhanced PICMG fru control
|
||||
* Integrated Andy Wray's DDR3 SPD parser patch
|
||||
* Adds function str2uint() to convert from string to uint32_t with
|
||||
checks for valid input.
|
||||
* Fix possible buffer overflow in buf2str()
|
||||
* Fixes ID 3485004 - misuse of strtol()
|
||||
* Replaces calls to strtol() with str2uchar() calls and adds error
|
||||
messages if invalid input is given.
|
||||
* Don't overwite the iflags bits prior to setting the boot parameters.
|
||||
This fixes ipmitool so that
|
||||
chassis bootdev bios clear-cmos=yes
|
||||
will correctly clear the bios cmos.
|
||||
* Clarify DCMI get limit activation (add if activate or not).
|
||||
* Bug fixes for delloem lan command. This includes the support for 12G
|
||||
Dell license and 12G LAN Specific command.
|
||||
* delloem commands should not be executed before parsing command line.
|
||||
* Fix stack overflow in delloem setled
|
||||
* Fix delloem powermonitor on big-endian platforms.
|
||||
* ipmitool delloem powermonitor command should convert data from
|
||||
network-format to the native one, otherwise it shows garbage
|
||||
on ppc/ppc64 platform.
|
||||
* Add ipmi_getsysinfo command
|
||||
* Add support for drive backplane SetLED functionality
|
||||
* Fix for Platform Event Message incorrect Generator ID
|
||||
* Fix fru print so that it will display FRU info from satellite
|
||||
controllers.
|
||||
* Add support for AMC type 17h record.
|
||||
* Fix in fru edit. It is now possible to edit field 0 of sections
|
||||
* New FRU get OEM record command
|
||||
* fixed segfault for fru edit when "field id" is not supported and
|
||||
added user feedback for string substitution(success or failure)
|
||||
* Improvement to hpm upgrade during activation. This resolves issue
|
||||
where activation seems to have failed because ipmitool received
|
||||
an unsupported completion code.
|
||||
* hpm Fixes for multi-platform support.
|
||||
* hpm Fix for timeouts during firmware rollback. If completion code
|
||||
is C3, wait till timeout has expired before reporting it.
|
||||
* hpm During manual rollback, code now gets target capabilities
|
||||
instead of using a default timeout of 60 seconds.
|
||||
* Added firmware auxilliary bytes to hpm outputs
|
||||
* hpm Add support for BIG Buffer (Use when -z option is used)
|
||||
* Fix the case where ipmitool loses the iol connection during the upload
|
||||
block process. Once IPMITool was successfully sent the first
|
||||
byte, IPMITool will not resize the block size.
|
||||
* Fix the problem when we try to upgrade specific component and the
|
||||
component is already updated,
|
||||
* updated HPM firmware agent to version 1.04
|
||||
* Fix exit code to return zero on '-o list' or '-o help' option
|
||||
* limit length of user name and password that can be supplied by user.
|
||||
Password is limited to 16 bytes, resp. 20 bytes, for LAN, resp.
|
||||
LAN+, interface. User name is limited to 16 bytes, no interface
|
||||
limitations. ID 3184687, ID 3001519
|
||||
* Add retry / timeout options for LAN
|
||||
* Changed default cipher suite to 1 instead of 3 for iol20
|
||||
* added fix for tracker ID 2849300 "Incorrect Firmware Revision"
|
||||
* avoid reopening the interface when already opened
|
||||
* Remove message for unsupported PEF capabilities that return valid
|
||||
CC (80h)
|
||||
* Added OEM byte (47) to verbose output
|
||||
* Add option to provide a list when filling sdr repository
|
||||
* SDR discovery speedups
|
||||
* Added support for Dell specific sensors
|
||||
* Fix segmentation fault on unrecognize OEM events.
|
||||
* changed SEL timestamp formatting for 'preinit' SEL entries, allowing
|
||||
the number of seconds to be displayed.
|
||||
* Added sensor raw data in verbose mode. Useful for OEM sensor type.
|
||||
* Add sensor hysteresis (positive & negative) to the following command
|
||||
ipmitool sensor -v
|
||||
* Fixes bug ID 3484936 - missing user input validation
|
||||
* Add missing RMCP+ auth type strings
|
||||
* Add new Kontron Product in ipmi_strings for product ID. Kontron
|
||||
KTC5520/EATX Server Motherboard with integrated iBMC/KVM/VM
|
||||
added identification support for Kontron AT8050 ATCA board
|
||||
* Constrain setting of the username to no greater than 16 characters
|
||||
per the IPMI specification. ID 3001519
|
||||
* Constrain User ID between 1 and 63. ID 3519225
|
||||
* Fixes ID 3485340 - user input not handled in 'lib/ipmi_user.c'
|
||||
* Fixes ignorance of existing daemon PID file which results in PID being
|
||||
overwritten. Adds proper umask() before writing PID file.
|
||||
* applied fix for ID 2865111 (AIX build)
|
||||
* Fix a proplem when using bridged IPMI commands on the lanplus
|
||||
interface (-I lanplus with -b -t or -m switches) resulting in
|
||||
"Close Session command failure".
|
||||
* Add fix with usage of CFh (duplicate request). Usefull for
|
||||
slow commands
|
||||
* Fix issue with sequence number. (Speed up transfer)
|
||||
|
||||
version 1.8.11 released 2009-02-25
|
||||
* Fix new GCC compilation issues in regards to Packing
|
||||
* Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
|
||||
for 2.4 kernel instead of ipmi_si_drv driver module
|
||||
* New -y option added to allow specification of kg keys with
|
||||
non-printable characters
|
||||
* New -K option added to allow kgkey settings via environmental
|
||||
variable IPMI_KGKEY
|
||||
* Generic device support added for EEPROM with SDR Type 10h (gendev)
|
||||
* Fix to lan-bridging for a double-bridging crash and to fix
|
||||
an issue with bridging multiple concurrent requests and
|
||||
erroneous handling of raw Send Message
|
||||
* Lanplus fix for commands like 'sensor list' without the -t option
|
||||
causing wrong double bridged requests of a sensor is located
|
||||
on another satellite controller
|
||||
* Fix lan and lanplus request list entry removal bugs
|
||||
* Fix non-working issue when trying to send a bridge message with
|
||||
Cipher 3
|
||||
* Change bridge message handling to reuse command ipmi_lan_poll_recv
|
||||
* Added PICMG 2.0 and 2.3 support
|
||||
* Fix PICMG (ATCA) extension verification and reversal of BCD encoded
|
||||
values for "major" and "minor" fields
|
||||
* Add IANA support for Pigeon Point
|
||||
* Add OEM SW/FW Record identification
|
||||
* Fix to include I2C and LUN addresses so sensors are correctly managed
|
||||
* Patch ID 1990560 to get readings from non-linear analog sensors
|
||||
* Add support for SOL payload status command
|
||||
* SOL set parameter range checking added
|
||||
* Fixed SOL activate options usage
|
||||
* Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
|
||||
* Added retries to SOL keepalive
|
||||
* Fixed wrong mask values for Front Panel disable/enable status
|
||||
* Add support to access fru internal use area
|
||||
* Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
|
||||
blocks of data within the FRU storage area to be write
|
||||
protected.
|
||||
* Fix node reporting in GUID; Tracker bug #2339675
|
||||
* Fix watchdog use/action print strings
|
||||
* Fix endian bug in SDR add from file; Tracker bug #2075258
|
||||
* Fix crash when dumping SDRs in a file and there's an error
|
||||
getting an SDR; improve algorithm for optimal packet size
|
||||
* Fix occasional SDR dump segfault; #1793076
|
||||
* Allow ipmitool sel delete to accept hex list entry numbers
|
||||
* Fix SEL total space reporting.
|
||||
* Fix for garbage sensor threshold values reported when none
|
||||
returned. Tracker Bug #863748
|
||||
* ipmievd change to Monitor %used in SEL buffer and log warnings when
|
||||
the buffer is 80% and 100% full
|
||||
|
||||
version 1.8.10 released 2008-08-08
|
||||
* Added support for BULL IANA number.
|
||||
* Fixed contrib build so the oem_ibm_sel_map file gets included in
|
||||
rpm builds again.
|
||||
* Added support for Debian packages to be built from CVS
|
||||
* Fix for sdr and sel timestamp reporting issues
|
||||
* Fix for discrete sensor state print routines to address state
|
||||
bits 8-14
|
||||
* Change ipmi_chassis_status() to non-static so it can be used
|
||||
externally
|
||||
* Added retries to SOL keepalive
|
||||
* Fix to stop sensor list command from reporting a failure due
|
||||
to missing sensor
|
||||
* Fix bug in sdr free space reporting
|
||||
* Add support for IANA number to vendor name conversion for many
|
||||
vendors
|
||||
* Fix segfault bug in lan set command
|
||||
* Fix bug in population of raw i2c wdata buffer
|
||||
* Fix bug in ipmb sensor reading
|
||||
* Fix misspellings, typos, incorrect strncmp lengths, white space
|
||||
* Update/fix printed help and usages for many commands
|
||||
* Add and update support for all commands in ipmitool man page
|
||||
* Fix for lanplus session re-open when the target becomes unavailable
|
||||
following a fw upgrade activation
|
||||
* Add support for watchdog timer shutoff, reset, and get info
|
||||
* Add support for more ibm systems in oem_ibm_sel_map
|
||||
* Add more JEDEC support info for DIMMs; decrease request size
|
||||
for DIMM FRU info to 16 bytes at a time to allow more
|
||||
DIMM FRUs to respond.
|
||||
* Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg
|
||||
buffer length more aggressively when no response from iol
|
||||
* Fix HPM firmware activation via IOL; fake a timeout after IOL
|
||||
session re-open to force get upgrade status retry;
|
||||
Added retries on 0xD3 completion code
|
||||
* Add support for freeipmi 0.6.0; adjust autoconf for changes
|
||||
* Fix for oemval2str size
|
||||
* Add support for product name resolution in mc info
|
||||
* Fix FRU display format
|
||||
* Added PICMG ekeying analyzer module support (ekanalyzer);
|
||||
display point to point physical connectivity and power
|
||||
supply information between carriers and AMC modules;
|
||||
display matched results of ekeying match between an
|
||||
on-carrier device and AMC module or between 2 AMC modules
|
||||
* Fix AMC GUID display support
|
||||
* Improved amcportstate operations
|
||||
* Added resolution for new sensor types
|
||||
* Fix segfault in SOL
|
||||
* Fix bug that caused infinite loop on BMCs with empty SDRs
|
||||
* Fix to move out Kontron OEM sensor resolution for other OEMs
|
||||
which could lead to bad event descriptions
|
||||
* Add new FRU edit mode thereby allowing serial numbers, etc. to be
|
||||
changed; improvements to OEM edit mode
|
||||
* Added SPD support for parms: channel number, max read size
|
||||
* Add SDR support for adding SDR records from a dumped file,
|
||||
clearing SDR, adding partial SDR records
|
||||
* Add updates and fixes to hpmfwupg: upload block size to 32 bytes
|
||||
for KCS, handle long response option, implement rollback
|
||||
override, garbage output fix
|
||||
* Add double bridge lan support , fix bridging issue
|
||||
* Add HPM support to pre-check which components need to be skipped
|
||||
* Fix autodetection of maximum packet size when using IPMB
|
||||
* Add new Kontron OEM command to set the BIOS boot option sequence
|
||||
* Add support for dual-bridge/ dual send message
|
||||
* Add auto-detect for local IPMB address using PICMG 2.X extension
|
||||
* Add support for HPM.1 1.0 specification compliance
|
||||
* Fix for improper lan/lanplus addressing
|
||||
* Added transit_channel and transit_addr to ipmi_intf struct
|
||||
* Fix bad password assertion bug due to rakp2 HMAC not being checked
|
||||
properly
|
||||
* Added ability to interpret PPS shelf manager clia sel dump
|
||||
* Corrected PICMG M7 state event definition macros
|
||||
* Added FRU parsing enhancements
|
||||
* Added "isol info", "isol set" and "isol activate" commands
|
||||
to support Intel IPMI v1.5 SOL functionality. Removed
|
||||
"isol setup" command.
|
||||
* Fix bug in ipmi_lan_recv_packet() in lan and lanplus interfaces.
|
||||
* Fix bug in "chassis poh" command.
|
||||
* Fix HPM.1 upgrade to apply to only given component when instructed
|
||||
to do so
|
||||
* Added configure auto-detection if dual bridge extension
|
||||
is supported by OpenIPMI
|
||||
|
||||
version 1.8.9 released 2007-03-06
|
||||
* Added initial AMC ekey query operation support
|
||||
* Improvements to ekeying support (PICMG 3.x only)
|
||||
* Added initial interactive edition support for multirec; added IANA
|
||||
verification before interpreting PICMG records.
|
||||
* Added edit support for AMC activation "Maximum Internal Current"
|
||||
* Fix bug generating garbage on the screen when handling GetDeviceId
|
||||
and sol traffic occurs
|
||||
* Added ability to map OEM sensor types to OEM description string using
|
||||
IANA number; moved IANA number table
|
||||
* Fix lan set access command to use value already saved within
|
||||
parameters for PEF and authentication
|
||||
* Fix bug in cmd ipmitool lan stats get 1
|
||||
* Add support to allow ipmitool/ipmievd to target specific device
|
||||
nodes on multi-BMC systems
|
||||
* Add support for name+privilege lookup for lanplus sessions
|
||||
* Fix time_t conversion bug for 64-bit OS
|
||||
* Added prefix of hostname on sel ipmievd sessions
|
||||
* Fixed FWUM Get Info
|
||||
* Fix ipmievd fd closing bug
|
||||
* Add set-in-progress flag support to chassis bootdev
|
||||
* Added new chassis bootdev options
|
||||
* Add sol payload enable/disable comman
|
||||
* Fix SOL set errors when commit-write not supported
|
||||
* Fix reset of session timeout for lanplus interface
|
||||
* Fixed lan interface accessibility timeout handling
|
||||
* Fix bug with Function Get Channel Cipher Suites command when
|
||||
more than 1 page used.
|
||||
* Fix missing firmware firewall top-level command
|
||||
* Fix bug in SOL keepalive functionality
|
||||
* Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
|
||||
* Added ipmi_sel_get_oem_sensor* APIs
|
||||
* Added HPM.1 support
|
||||
* Fix segfault when incorrect oem option supplied
|
||||
* Fix bus problem with spd command
|
||||
* Fix segfault in SOL when remote BMC does not return packet
|
||||
* Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
|
||||
* Added lan packet size reduction mechanism
|
||||
* Fix bug with sendMessage of bad length with different target
|
||||
* Fix for big endian (PPC) architecture
|
||||
* NetBSD fixes
|
||||
* Fix segfault and channel problem with user priv command
|
||||
* Add support for bus/chan on i2c raw command
|
||||
* Add freeipmi interface support
|
||||
* Add remote spd printing
|
||||
* Add better detection of linux/compiler.h to config
|
||||
* Makefile changes to fix makedistcheck, etc.
|
||||
|
||||
version 1.8.8
|
||||
* Fix segfaults in sensor data repository list
|
||||
* Fix ipmievd to open interface before daemonizing
|
||||
* Fix IPMIv1.5 authtype NONE to ignore supplied password
|
||||
* Fix cipher suite display bug in lan print
|
||||
* Fix typo in IPMIv2 SOL output when sending break
|
||||
* Fix improper LUN handling with Tyan SOL
|
||||
* Add LUN support to OpenIPMI interface
|
||||
* Add support for Kontron OEM commands
|
||||
* Update to Kontron Firmware Update command
|
||||
|
||||
version 1.8.7
|
||||
* Remove nuclear clause from license
|
||||
* Add Sun OEM command for blades
|
||||
* Increase argument size for raw commands in shell/exec
|
||||
* Fix handling of LUNs for LAN interfaces
|
||||
* Add IPMIv2 SOL loopback test
|
||||
* Add support for IBM OEM SEL messages
|
||||
* Disable file paranoia checks on read files by default
|
||||
* Support IPMIv2 SOL on older Intel boxes
|
||||
* Display message and exit if keepalive fails during SOL
|
||||
* Add support for setting VLAN id and priority
|
||||
* Add support for FreeBSD OpenIPMI-compatible driver
|
||||
* Add support for IPMIv2 Firmware Firewall
|
||||
* Fix gcc4 compile warnings
|
||||
* Make ipmievd generate pidfile
|
||||
* Add initscripts for ipmievd
|
||||
|
||||
version 1.8.6
|
||||
* Fix memory corruption when sending encrypted SOL traffic
|
||||
* Add keepalive timer to IPMIv2 SOL sessions
|
||||
|
||||
version 1.8.5
|
||||
* Add support for settable SOL escape character with -e option
|
||||
* Add support for Kg BMC key for IPMIv2 authentication with -k option
|
||||
* Add support for Tyan IPMIv1.5 SOL with tsol command
|
||||
* Add support for PICMG devices
|
||||
* Add support for OEM SEL event parsing
|
||||
* Add support for command bridging over lan and lanplus interfaces
|
||||
* New 'chassis selftest' command
|
||||
* Many bufxies and patches from contributors
|
||||
|
||||
version 1.8.3
|
||||
* Add support for 'sel readraw' and 'sel writeraw' commands.
|
||||
* Add support for entering NetFn as a string for RAW commands.
|
||||
|
@ -27,13 +27,9 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
DOCDIR = $(DESTDIR)/$(datadir)/doc/$(PACKAGE)
|
||||
DOCLIST = README COPYING AUTHORS ChangeLog
|
||||
DOCDIR = $(datadir)/doc/$(PACKAGE)
|
||||
DOCLIST = $(top_srcdir)/README $(top_srcdir)/COPYING $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog
|
||||
|
||||
EXTRA_DIST = $(DOCLIST) \
|
||||
debian/changelog debian/control debian/copyright \
|
||||
@ -52,8 +48,11 @@ dist-hook:
|
||||
cp control/ipmitool.spec $(distdir)
|
||||
|
||||
install-data-local:
|
||||
mkdir -p $(DOCDIR)
|
||||
install -m 644 $(DOCLIST) $(DOCDIR)
|
||||
mkdir -p $(DESTDIR)$(DOCDIR)
|
||||
$(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)
|
||||
|
||||
uninstall-local:
|
||||
-rm -rf $(DESTDIR)$(DOCDIR)
|
||||
|
||||
.PHONY: pkg
|
||||
pkg: PKG := ipmitool-@VERSION@-@OS@-@ARCH@
|
||||
@ -80,4 +79,3 @@ rpm: control/ipmitool.spec dist
|
||||
.PHONY: clean-rpm
|
||||
clean-rpm:
|
||||
-rm -rf $(RPMDIR)
|
||||
|
||||
|
105
ipmitool/README
105
ipmitool/README
@ -1,7 +1,7 @@
|
||||
|
||||
ipmitool
|
||||
Duncan Laurie
|
||||
duncan@iceblink.org
|
||||
ipmitool-devel@lists.sourceforge.net
|
||||
|
||||
Overview
|
||||
========
|
||||
@ -131,6 +131,109 @@ no problems. The IPMIv1.5 interface will attempt to use OpenSSL for MD5
|
||||
hash function at compile time but if that is not found it will use an
|
||||
internal library.
|
||||
|
||||
IPMB Dual Bridging in IPMITOOL
|
||||
-------------------------------
|
||||
|
||||
IPMI offers a standard messaging interface.
|
||||
|
||||
The following concepts are related to this messaging interface:
|
||||
|
||||
Channel type : Communication channel type (SMS/KCS, IPMB, LAN)
|
||||
Channel number : Channel descriptor
|
||||
Requester : Address of the requester
|
||||
Responder : Address of the responder
|
||||
NetFN : The logical function for the request/response.
|
||||
Command : The command number
|
||||
Sequence : An ID identifiying the request/response pair
|
||||
Message tracking : The ability to match request/response pair.
|
||||
|
||||
When a communication is issued through any of the channels, an application
|
||||
formats a request and expect a response.
|
||||
|
||||
Direct Command
|
||||
--------------
|
||||
The simplest form of communication is a "direct command" using SMS/KCS
|
||||
|
||||
Example:
|
||||
ipmitool raw 6 4
|
||||
55 00
|
||||
|
||||
This send raw command 4 (selftest) from netfn 6(application) to KCS, the driver
|
||||
takes care of 'message tracking' and provides the answer.
|
||||
|
||||
Hopefully, the application also includes a "human readable" instance of the API:
|
||||
ipmitool mc selftest
|
||||
Selftest: passed
|
||||
|
||||
Bridged Command
|
||||
---------------
|
||||
One slightly more complicated communication mode is the so-called
|
||||
"bridged command" using IPMB.
|
||||
|
||||
Example:
|
||||
ipmitool -m 0x94 -t 0x9a raw 6 4
|
||||
55 00
|
||||
|
||||
or
|
||||
|
||||
ipmitool -m 0x94 -t 0x9a mc selftest
|
||||
Selftest: passed
|
||||
|
||||
|
||||
This still sends the same command 4 (selftest) from netfn 6(application) to
|
||||
the target. However, to do so, the command is encapsulated (by the driver) and
|
||||
sent using the command 0x34 (send message) from netfn 6(application) to KCS.
|
||||
Then KCS is polled by the driver until a message has been received, then the
|
||||
driver uses command 0x33 (get message). The driver also tracks the message
|
||||
and makes sure the response matches the request. Then it decapsultates the
|
||||
message and gives the response back to the application.
|
||||
|
||||
Dual Bridged Command
|
||||
--------------------
|
||||
Things get a little more ugly when the application needs to reach a management
|
||||
controller sitting on an interface (or channel) not directly connected to the
|
||||
BMC/IPMC. In the case the application must encapsulate its message itself and
|
||||
request the IPMC to deal with message tracking itself.
|
||||
|
||||
Its been working well with IPMITOOL on the LAN interface with:
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x20 -t 0x7a -b 7
|
||||
mc selftest
|
||||
|
||||
However, trying to dual bridge commands locally with :
|
||||
ipmitool -B 0 -T 0x9a -m 0x94 -t 0x7a -b 7 mc selftest didn't work
|
||||
(it returned the same data as ipmitool -m 0x20 -t 0x7a -b 7 mc selftest )
|
||||
|
||||
The reason was that the "openipmi" interface pluging didn't
|
||||
encapsulate/decapsulate the message and didn't even detect the intent
|
||||
to double bridge the request.
|
||||
|
||||
./src/ipmitool -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7 mc selftest
|
||||
|
||||
-B 0 : transit channel for first bridge level (channel 0: IPMB-0)
|
||||
-T 0x8a : transit destination address (remote IPMC address)
|
||||
-m 0x94 : source address (local IPMC address on IPMB-0)
|
||||
-t 0x7a : remote target (AMC IPMB-L address)
|
||||
-b 7 : remote channel (channel 7: IPMB-L)
|
||||
|
||||
The transit source address (remote IPMC address on remote channel) is
|
||||
automatically assigned by the remote IPMC.
|
||||
|
||||
Payload Size Limit
|
||||
------------------
|
||||
Because some commands return a lot of data (fru read/get sdr) and because 2
|
||||
levels of encapsulation are used, some command will fail.
|
||||
|
||||
For instance this works.
|
||||
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
|
||||
mc selftest
|
||||
|
||||
but this does not:
|
||||
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
|
||||
fru print.
|
||||
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
@ -29,10 +29,6 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
aclocal
|
||||
libtoolize --automake --copy
|
||||
|
@ -3,7 +3,7 @@ dnl autoconf for ipmitool
|
||||
dnl
|
||||
AC_INIT([src/ipmitool.c])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.8.5])
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.8.13rc0-cvs])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_SRCDIR([src/ipmitool.c])
|
||||
AC_PREREQ(2.50)
|
||||
@ -18,7 +18,7 @@ AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
|
||||
AC_CHECK_PROG([SED], [sed], [sed])
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h termios.h])
|
||||
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
|
||||
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
|
||||
|
||||
@ -33,7 +33,7 @@ AC_CHECK_FUNCS([alarm gethostbyname socket select])
|
||||
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
|
||||
AC_CHECK_FUNCS([getpassphrase])
|
||||
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing -Wreturn-type"
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
@ -44,14 +44,24 @@ AC_SEARCH_LIBS([socket], [socket], [],
|
||||
[LIBS="$LIBS -lsocket -lnsl"], [], [-lsocket])])
|
||||
|
||||
if test "x$prefix" = "xNONE"; then
|
||||
prefix="$ac_default_prefix"
|
||||
prefix="$ac_default_prefix"
|
||||
fi
|
||||
|
||||
if test "x$exec_prefix" = "xNONE"; then
|
||||
exec_prefix="$prefix"
|
||||
exec_prefix="$prefix"
|
||||
fi
|
||||
|
||||
enable_all_options=yes
|
||||
dnl
|
||||
dnl set default option values
|
||||
dnl
|
||||
|
||||
xenable_intf_bmc=no
|
||||
xenable_intf_imb=yes
|
||||
xenable_intf_open=yes
|
||||
xenable_intf_lipmi=yes
|
||||
#xenable_intf_serial=yes
|
||||
xenable_all_options=yes
|
||||
xenable_ipmishell=yes
|
||||
|
||||
dnl set some things so we build with GNU tools on Solaris
|
||||
case "$host_os" in
|
||||
@ -61,35 +71,40 @@ solaris*)
|
||||
LD=gld
|
||||
AR=gar
|
||||
# openssl libs are in /usr/sfw/lib on solaris 10
|
||||
LIBS="$LIBS -R/usr/sfw/lib"
|
||||
LIBS="$LIBS -R/usr/sfw/lib"
|
||||
# disable the linux-specific interfaces
|
||||
# and bmc on SPARC (there is no bmc driver for SPARC)
|
||||
if [[ `mach -p` = sparc ]]; then
|
||||
enable_intf_bmc=no
|
||||
else
|
||||
enable_intf_bmc=yes
|
||||
fi
|
||||
enable_intf_imb=no
|
||||
enable_intf_open=no
|
||||
enable_intf_lipmi=no
|
||||
enable_ipmishell=no
|
||||
enable_all_options=no
|
||||
xenable_intf_bmc=yes
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_ipmishell=no
|
||||
xenable_all_options=no
|
||||
;;
|
||||
*cygwin*)
|
||||
# disable the linux and solaris-specific interfaces
|
||||
enable_intf_imb=no
|
||||
enable_intf_open=no
|
||||
enable_intf_lipmi=no
|
||||
enable_intf_bmc=no
|
||||
enable_ipmishell=no
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_intf_bmc=no
|
||||
;;
|
||||
*darwin*)
|
||||
*darwin*|aix*)
|
||||
# disable the linux and solaris-specific interfaces
|
||||
enable_intf_imb=no
|
||||
enable_intf_open=no
|
||||
enable_intf_lipmi=no
|
||||
enable_intf_bmc=no
|
||||
enable_ipmishell=no
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_intf_bmc=no
|
||||
xenable_ipmishell=no
|
||||
;;
|
||||
*freebsd*)
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_intf_bmc=no
|
||||
;;
|
||||
*netbsd*)
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_intf_bmc=no
|
||||
xenable_intf_open=no
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -102,74 +117,100 @@ dnl allow solaris builds to include all options
|
||||
AC_ARG_ENABLE([solaris-opt],
|
||||
[AC_HELP_STRING([--enable-solaris-opt],
|
||||
[enable all options for Solaris [default=no]])],
|
||||
[], [enable_solaris_opt=no])
|
||||
if test "x$enable_all_options" = "xyes" || test "x$enable_solaris_opt" = "xyes"; then
|
||||
AC_DEFINE(ENABLE_ALL_OPTIONS, [1], [Define to 1 to enable all command line options.])
|
||||
[xenable_solaris_opt=$enableval],
|
||||
[xenable_solaris_opt=no])
|
||||
if test "x$xenable_all_options" = "xyes" || test "x$xenable_solaris_opt" = "xyes"; then
|
||||
AC_DEFINE(ENABLE_ALL_OPTIONS, [1], [Define to 1 to enable all command line options.])
|
||||
fi
|
||||
|
||||
dnl check for OpenSSL functionality
|
||||
AC_ARG_ENABLE([internal-md5],
|
||||
[AC_HELP_STRING([--enable-internal-md5],
|
||||
[enable internal MD5 library [default=no]])],
|
||||
[], [enable_internal_md5=no])
|
||||
[xenable_internal_md5=$enableval],
|
||||
[xenable_internal_md5=no])
|
||||
|
||||
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
[if test "x$xenable_internal_md5" != "xyes"; then
|
||||
have_crypto=yes; LIBS="$LIBS -lcrypto"
|
||||
fi], [have_crypto=no], [-lcrypto])
|
||||
fi],
|
||||
[have_crypto=no], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD5_Init],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
[if test "x$xenable_internal_md5" != "xyes"; then
|
||||
if test "x$have_crypto" != "xyes"; then
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md5=yes
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md5=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
|
||||
fi], [], [-lcrypto])
|
||||
fi],
|
||||
[], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD2_Init],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
[if test "x$xenable_internal_md5" != "xyes"; then
|
||||
if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md2=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.])
|
||||
fi], [], [-lcrypto])
|
||||
fi],
|
||||
[], [-lcrypto])
|
||||
|
||||
dnl enable IPMIv1.5 LAN interface
|
||||
AC_ARG_ENABLE([intf-lan],
|
||||
[AC_HELP_STRING([--enable-intf-lan],
|
||||
[enable IPMIv1.5 LAN interface [default=yes]])],
|
||||
[], [enable_intf_lan=yes])
|
||||
if test "x$enable_intf_lan" = "xstatic" || test "x$enable_intf_lan" = "xplugin"; then
|
||||
enable_intf_lan=yes
|
||||
[xenable_intf_lan=$enableval],
|
||||
[xenable_intf_lan=yes])
|
||||
if test "x$xenable_intf_lan" = "xstatic" || test "x$xenable_intf_lan" = "xplugin"; then
|
||||
xenable_intf_lan=yes
|
||||
fi
|
||||
if test "x$enable_intf_lan" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
|
||||
AC_SUBST(INTF_LAN, [lan])
|
||||
AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
|
||||
if test "x$xenable_intf_lan" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
|
||||
AC_SUBST(INTF_LAN, [lan])
|
||||
AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
|
||||
fi
|
||||
|
||||
dnl enable IPMIv2.0 RMCP+ LAN interface
|
||||
AC_ARG_ENABLE([intf-lanplus],
|
||||
[AC_HELP_STRING([--enable-intf-lanplus],
|
||||
[enable IPMIv2.0 RMCP+ LAN interface [default=auto]])],
|
||||
[if test "x$enable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
|
||||
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
|
||||
enable_intf_lanplus=no
|
||||
fi],
|
||||
[enable_intf_lanplus=$have_crypto])
|
||||
if test "x$enable_intf_lanplus" = "xstatic" || test "x$enable_intf_lanplus" = "xplugin"; then
|
||||
enable_intf_lanplus=yes
|
||||
[xenable_intf_lanplus=$enableval],
|
||||
[xenable_intf_lanplus=$have_crypto])
|
||||
if test "x$xenable_intf_lanplus" = "xstatic" || test "x$xenable_intf_lanplus" = "xplugin"; then
|
||||
xenable_intf_lanplus=yes
|
||||
fi
|
||||
if test "x$enable_intf_lanplus" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
|
||||
AC_SUBST(INTF_LANPLUS, [lanplus])
|
||||
AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
|
||||
if test "x$xenable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
|
||||
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
|
||||
xenable_intf_lanplus=no
|
||||
fi
|
||||
if test "x$xenable_intf_lanplus" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
|
||||
AC_SUBST(INTF_LANPLUS, [lanplus])
|
||||
AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
|
||||
else
|
||||
enable_intf_lanplus=no
|
||||
xenable_intf_lanplus=no
|
||||
fi
|
||||
|
||||
ORIG_CPPFLAGS=$CPPFLAGS
|
||||
|
||||
dnl enable serial interface
|
||||
AC_ARG_ENABLE([intf-serial],
|
||||
[AC_HELP_STRING([--enable-intf-serial],
|
||||
[enable direct Serial Basic/Terminal mode interface [default=yes]])],
|
||||
[xenable_intf_serial=$enableval], [xenable_intf_serial=yes])
|
||||
if test "x$enable_intf_serial" = "xstatic" || test "x$enable_intf_serial" = "xplugin"; then
|
||||
xenable_intf_serial=yes
|
||||
fi
|
||||
if test "x$xenable_intf_serial" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_SERIAL, [1], [Define to 1 to enable serial interface.])
|
||||
AC_SUBST(INTF_SERIAL, [serial])
|
||||
AC_SUBST(INTF_SERIAL_LIB, [libintf_serial.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB serial/libintf_serial.la"
|
||||
else
|
||||
xenable_intf_serial=no
|
||||
fi
|
||||
|
||||
dnl look for OpenIPMI header files
|
||||
@ -181,18 +222,177 @@ AC_ARG_WITH([kerneldir],
|
||||
fi
|
||||
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
|
||||
AC_SUBST(CFLAGS)
|
||||
CPPFLAGS="$CPPFLAGS -I ${with_kerneldir}/include"
|
||||
AC_SUBST(CPPFLAGS)
|
||||
if test -s ${with_kerneldir}/include/linux/version.h ; then
|
||||
kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
|
||||
sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
|
||||
if test "x$kernelver" = "x2.6"; then
|
||||
CPPFLAGS="$CPPFLAGS -D__user="
|
||||
AC_SUBST(CPPFLAGS)
|
||||
CPPFLAGS="$CPPFLAGS -D__user="
|
||||
AC_SUBST(CPPFLAGS)
|
||||
fi
|
||||
fi])
|
||||
|
||||
AH_TEMPLATE([HAVE_LINUX_COMPILER_H], [])
|
||||
AC_MSG_CHECKING([for linux/compiler.h])
|
||||
|
||||
m4_version_prereq([2.68],
|
||||
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <linux/compiler.h>]])],
|
||||
[AC_DEFINE(HAVE_LINUX_COMPILER_H, [1],
|
||||
[Define to 1 if you have the <linux/compiler.h> header file.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])])],
|
||||
[AC_PREPROC_IFELSE([#include <linux/compiler.h>],
|
||||
[AC_DEFINE(HAVE_LINUX_COMPILER_H, [1],
|
||||
[Define to 1 if you have the <linux/compiler.h> header file.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])])])
|
||||
|
||||
CPPFLAGS=$ORIG_CPPFLAGS
|
||||
AC_SUBST(CPPFLAGS)
|
||||
|
||||
AC_CHECK_HEADER([sys/ioccom.h],
|
||||
[AC_DEFINE(HAVE_SYS_IOCCOM_H, [1],
|
||||
[Define to 1 if you have the <sys/ioccom.h> header file.])])
|
||||
|
||||
AC_CHECK_HEADER([linux/ipmi.h],
|
||||
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
|
||||
[Define to 1 if you have the <linux/ipmi.h> header file.])],
|
||||
[echo "** Unable to find OpenIPMI header files. Using internal version."])
|
||||
[AC_CHECK_HEADER([sys/ipmi.h],
|
||||
[AC_DEFINE(HAVE_FREEBSD_IPMI_H, [1],
|
||||
[Define to 1 if you have the <sys/ipmi.h> header file.])],
|
||||
[echo "** Unable to find OpenIPMI header files. Using internal version."])])
|
||||
|
||||
dnl look for FreeIPMI files
|
||||
AC_CHECK_LIB(freeipmi, ipmi_open_inband, [have_free=yes], [have_free=no])
|
||||
if test "x$have_free" != "xyes"; then
|
||||
AC_CHECK_LIB(freeipmi, ipmi_ctx_open_inband, [have_free=yes], [have_free=no])
|
||||
fi
|
||||
AC_ARG_ENABLE([intf-free],
|
||||
[AC_HELP_STRING([--enable-intf-free],
|
||||
[enable FreeIPMI IPMI interface [default=auto]])],
|
||||
[xenable_intf_free=$enableval],
|
||||
[xenable_intf_free=$have_free])
|
||||
if test "x$xenable_intf_free" = "xstatic" || test "x$xenable_intf_free" = "xplugin"; then
|
||||
xenable_intf_free=yes
|
||||
fi
|
||||
if test "x$xenable_intf_free" != "xno" && test "x$have_free" != "xyes"; then
|
||||
echo "** Unable to build FreeIPMI interface support!"
|
||||
xenable_intf_free=no
|
||||
fi
|
||||
if test "x$xenable_intf_free" = "xyes"; then
|
||||
dnl Determine if you got the right FreeIPMI version
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.3.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev;
|
||||
dev = ipmi_open_inband(IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0);
|
||||
], ac_free_version_0_3_0=yes, ac_free_version_0_3_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_3_0)
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.4.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev = NULL;
|
||||
int rv;
|
||||
dev = ipmi_device_create();
|
||||
rv = ipmi_open_inband(dev,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0);
|
||||
], ac_free_version_0_4_0=yes, ac_free_version_0_4_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_4_0)
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.5.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev = NULL;
|
||||
int rv;
|
||||
dev = ipmi_device_create();
|
||||
rv = ipmi_open_inband(dev,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
], ac_free_version_0_5_0=yes, ac_free_version_0_5_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_5_0)
|
||||
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.6.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
], [
|
||||
ipmi_ctx_t ctx = NULL;
|
||||
int rv;
|
||||
ctx = ipmi_ctx_create();
|
||||
rv = ipmi_ctx_open_inband(ctx,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
], ac_free_version_0_6_0=yes, ac_free_version_0_6_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_6_0)
|
||||
|
||||
if test "x$ac_free_version_0_3_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_4_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_5_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_6_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE, [1], [Define to 1 to enable FreeIPMI interface.])
|
||||
AC_SUBST(INTF_FREE, [free])
|
||||
AC_SUBST(INTF_FREE_LIB, [libintf_free.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB free/libintf_free.la"
|
||||
if test "x$ac_free_version_0_3_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_3_0, [1], [Define to 1 for FreeIPMI 0.3.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_4_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_4_0, [1], [Define to 1 for FreeIPMI 0.4.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_5_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_5_0, [1], [Define to 1 for FreeIPMI 0.5.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_6_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_6_0, [1], [Define to 1 for FreeIPMI 0.6.0.])
|
||||
fi
|
||||
else
|
||||
xenable_intf_free=no
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(freeipmi,
|
||||
ipmi_cmd_raw_ipmb,
|
||||
AC_DEFINE(IPMI_INTF_FREE_BRIDGING, [1],
|
||||
[Define to 1 to enable FreeIPMI Bridging Support.]))
|
||||
fi
|
||||
|
||||
dnl look for termios header file
|
||||
AC_CHECK_HEADER([termios.h],
|
||||
[AC_DEFINE(HAVE_TERMIOS_H, [1], [Define to 1 if you have <termios.h>.])],
|
||||
[AC_CHECK_HEADER([sys/termios.h],
|
||||
[AC_DEFINE(HAVE_SYS_TERMIOS_H, [1], [Define to 1 if you have <sys/termios.h>.])],
|
||||
[echo "** Unable to find termios header file."])])
|
||||
|
||||
dnl set RPM distro tag for use in RPM name
|
||||
AC_ARG_WITH([rpm-distro],
|
||||
@ -200,34 +400,70 @@ AC_ARG_WITH([rpm-distro],
|
||||
[set Linux distribution tag for use in RPM version string])],
|
||||
[AC_SUBST(DISTRO, $with_rpm_distro)])
|
||||
|
||||
dnl set RPM release tag
|
||||
AC_ARG_WITH([rpm-release],
|
||||
[AC_HELP_STRING([--with-rpm-release=RELEASE],
|
||||
[set release number for RPM release field])],
|
||||
[], [with_rpm_release=1])
|
||||
AC_SUBST(RPM_RELEASE, $with_rpm_release)
|
||||
|
||||
dnl enable Linux OpenIPMI interface
|
||||
AC_ARG_ENABLE([intf-open],
|
||||
[AC_HELP_STRING([--enable-intf-open],
|
||||
[enable Linux OpenIPMI interface [default=auto]])],
|
||||
[], [enable_intf_open=yes])
|
||||
if test "x$enable_intf_open" = "xstatic" || test "x$enable_intf_open" = "xplugin"; then
|
||||
enable_intf_open=yes
|
||||
[xenable_intf_open=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_open" = "xstatic" || test "x$xenable_intf_open" = "xplugin"; then
|
||||
xenable_intf_open=yes
|
||||
fi
|
||||
if test "x$enable_intf_open" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
|
||||
AC_SUBST(INTF_OPEN, [open])
|
||||
AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
|
||||
if test "x$xenable_intf_open" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
|
||||
AC_SUBST(INTF_OPEN, [open])
|
||||
AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
|
||||
|
||||
dnl Check for dual bridge support in OpenIPMI
|
||||
AC_MSG_CHECKING([for OpenIPMI dual bridge support])
|
||||
have_openipmi_dual_bridge=no
|
||||
ORIG_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -Isrc/plugins/open -DENABLE_INTF_OPEN_DUAL_BRIDGE"
|
||||
AC_TRY_COMPILE([
|
||||
#if defined(HAVE_OPENIPMI_H)
|
||||
# if defined(HAVE_LINUX_COMPILER_H)
|
||||
# include <linux/compiler.h>
|
||||
# endif
|
||||
# include <linux/ipmi.h>
|
||||
#elif defined(HAVE_FREEBSD_IPMI_H)
|
||||
# include <sys/ipmi.h>
|
||||
#else
|
||||
# include "open.h"
|
||||
#endif
|
||||
], [
|
||||
struct ipmi_ipmb_addr a;
|
||||
a.transit_slave_addr = 0;
|
||||
], [have_openipmi_dual_bridge=yes])
|
||||
if test x"$have_openipmi_dual_bridge" = x"yes"; then
|
||||
AC_DEFINE(ENABLE_INTF_OPEN_DUAL_BRIDGE, [1],
|
||||
[Define to 1 to enable OpenIPMI interface dual bridge support])
|
||||
fi
|
||||
CPPFLAGS="$ORIG_CPPFLAGS"
|
||||
AC_MSG_RESULT([$have_openipmi_dual_bridge])
|
||||
fi
|
||||
|
||||
dnl enable Intel IMB interface
|
||||
AC_ARG_ENABLE([intf-imb],
|
||||
[AC_HELP_STRING([--enable-intf-imb],
|
||||
[enable Intel IMB driver interface [default=auto]])],
|
||||
[], [enable_intf_imb=yes])
|
||||
if test "x$enable_intf_imb" = "xstatic" || test "x$enable_intf_imb" = "xplugin"; then
|
||||
enable_intf_imb=yes
|
||||
[xenable_intf_imb=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_imb" = "xstatic" || test "x$xenable_intf_imb" = "xplugin"; then
|
||||
xenable_intf_imb=yes
|
||||
fi
|
||||
if test "x$enable_intf_imb" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
|
||||
AC_SUBST(INTF_IMB, [imb])
|
||||
AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
|
||||
if test "x$xenable_intf_imb" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
|
||||
AC_SUBST(INTF_IMB, [imb])
|
||||
AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
|
||||
fi
|
||||
|
||||
dnl enable Solaris LIPMI interface
|
||||
@ -235,62 +471,116 @@ AC_CHECK_HEADER([sys/lipmi/lipmi_intf.h], [have_lipmi=yes], [have_lipmi=no])
|
||||
AC_ARG_ENABLE([intf-lipmi],
|
||||
[AC_HELP_STRING([--enable-intf-lipmi],
|
||||
[enable Solaris 9 x86 IPMI interface [default=no]])],
|
||||
[if test "x$enable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
|
||||
echo "** Unable to build Solaris 9 x86 IPMI interface support!"
|
||||
enable_intf_lipmi=no
|
||||
fi],
|
||||
[enable_intf_lipmi=no])
|
||||
if test "x$enable_intf_lipmi" = "xstatic" || test "x$enable_intf_lipmi" = "xplugin"; then
|
||||
enable_intf_lipmi=yes
|
||||
[xenable_intf_lipmi=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_lipmi" = "xstatic" || test "x$xenable_intf_lipmi" = "xplugin"; then
|
||||
xenable_intf_lipmi=yes
|
||||
fi
|
||||
if test "x$enable_intf_lipmi" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.])
|
||||
AC_SUBST(INTF_LIPMI, [lipmi])
|
||||
AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
|
||||
if test "x$xenable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
|
||||
echo "** Unable to build Solaris 9 x86 IPMI interface support!"
|
||||
xenable_intf_lipmi=no
|
||||
fi
|
||||
if test "x$xenable_intf_lipmi" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.])
|
||||
AC_SUBST(INTF_LIPMI, [lipmi])
|
||||
AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
|
||||
fi
|
||||
|
||||
dnl enable Solaris BMC interface
|
||||
AC_ARG_ENABLE([intf-bmc],
|
||||
[AC_HELP_STRING([--enable-intf-bmc],
|
||||
[enable Solaris 10 x86 IPMI interface [default=auto]])],,
|
||||
[enable_intf_bmc=no])
|
||||
if test "x$enable_intf_bmc" = "xstatic" || test "x$enable_intf_bmc" = "xplugin"; then
|
||||
enable_intf_bmc=yes
|
||||
[enable Solaris 10 x86 IPMI interface [default=auto]])],
|
||||
[xenable_intf_bmc=$enableval],
|
||||
[xenable_intf_bmc=no])
|
||||
if test "x$xenable_intf_bmc" = "xstatic" || test "x$xenable_intf_bmc" = "xplugin"; then
|
||||
xenable_intf_bmc=yes
|
||||
fi
|
||||
if test "x$enable_intf_bmc" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.])
|
||||
AC_SUBST(INTF_BMC, [bmc])
|
||||
AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
|
||||
if test "x$xenable_intf_bmc" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.])
|
||||
AC_SUBST(INTF_BMC, [bmc])
|
||||
AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
|
||||
fi
|
||||
|
||||
AC_SUBST(IPMITOOL_INTF_LIB)
|
||||
|
||||
if test "x$xenable_ipmishell" = "xyes"; then
|
||||
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
|
||||
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
|
||||
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
|
||||
if test "x$have_curses" != "xyes" || test "x$have_readline" != "xyes"; then
|
||||
xenable_ipmishell=no
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl check for readline library to enable ipmi shell
|
||||
AC_ARG_ENABLE([ipmishell],
|
||||
[AC_HELP_STRING([--enable-ipmishell],
|
||||
[enable IPMI shell interface [default=yes]])],
|
||||
[], [enable_ipmishell=yes])
|
||||
if test "x$enable_ipmishell" = "xyes"; then
|
||||
AC_SEARCH_LIBS([tgetent], [readline ncurses curses termcap])
|
||||
AC_SEARCH_LIBS([initscr], [curses ncurses], [have_curses=yes])
|
||||
[enable IPMI shell interface [default=auto]])],
|
||||
[xenable_ipmishell=$enableval],
|
||||
[])
|
||||
if test "x$xenable_ipmishell" = "xyes"; then
|
||||
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
|
||||
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
|
||||
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
|
||||
if test "x$have_curses" = "xyes" && test "x$have_readline" = "xyes"; then
|
||||
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
|
||||
if test "x$have_curses" != "xyes"; then
|
||||
AC_MSG_ERROR([** Unable to find curses required by ipmishell.])
|
||||
fi
|
||||
if test "x$have_readline" != "xyes"; then
|
||||
AC_MSG_ERROR([** Unable to find readline required by ipmishell.])
|
||||
fi
|
||||
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
|
||||
fi
|
||||
|
||||
dnl Enable -Wall -Werror
|
||||
AC_ARG_ENABLE([buildcheck],
|
||||
[AC_HELP_STRING([--enable-buildcheck],
|
||||
[enable -Wall -Werror for build testing [default=no]])],
|
||||
[if test "x$enable_buildcheck" != "xno"; then
|
||||
CFLAGS="$CFLAGS -Wall -Werror -Wpointer-arith -Wstrict-prototypes"
|
||||
fi], [])
|
||||
|
||||
[xenable_buildcheck=$enableval],
|
||||
[xenable_buildcheck=no])
|
||||
if test "x$xenable_buildcheck" != "xno"; then
|
||||
CFLAGS="$CFLAGS -Wall -Werror -Wpointer-arith -Wstrict-prototypes"
|
||||
fi
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
dnl Enable extra file security paranoia
|
||||
AC_ARG_ENABLE([file-security],
|
||||
[AC_HELP_STRING([--enable-file-security],
|
||||
[enable extra security checks on files opened for read [default=no]])],
|
||||
[xenable_file_security=$enableval],
|
||||
[xenable_file_security=no])
|
||||
if test "x$xenable_file_security" != "xno"; then
|
||||
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
|
||||
fi
|
||||
|
||||
|
||||
AC_TRY_COMPILE([],[
|
||||
#include <stdio.h>
|
||||
|
||||
struct packstruct {
|
||||
unsigned char t0 :5;
|
||||
unsigned char t1 :5;
|
||||
unsigned char t2 :5;
|
||||
unsigned char t3 :5;
|
||||
unsigned char t4 :4;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
if(sizeof(struct packstruct) != 3)
|
||||
return(1);
|
||||
else
|
||||
return(0);
|
||||
}
|
||||
],
|
||||
[],
|
||||
[AC_DEFINE(HAVE_PRAGMA_PACK,[1],
|
||||
[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])]
|
||||
)
|
||||
|
||||
|
||||
dnl Generate files for build
|
||||
AC_CONFIG_FILES([Makefile
|
||||
doc/Makefile
|
||||
@ -306,11 +596,13 @@ AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
src/plugins/Makefile
|
||||
src/plugins/lan/Makefile
|
||||
src/plugins/lanplus/Makefile
|
||||
src/plugins/lanplus/Makefile
|
||||
src/plugins/open/Makefile
|
||||
src/plugins/free/Makefile
|
||||
src/plugins/imb/Makefile
|
||||
src/plugins/bmc/Makefile
|
||||
src/plugins/lipmi/Makefile])
|
||||
src/plugins/lipmi/Makefile
|
||||
src/plugins/serial/Makefile])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@ -318,14 +610,17 @@ AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([ipmitool $VERSION])
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([Interfaces])
|
||||
AC_MSG_RESULT([ lan : $enable_intf_lan])
|
||||
AC_MSG_RESULT([ lanplus : $enable_intf_lanplus])
|
||||
AC_MSG_RESULT([ open : $enable_intf_open])
|
||||
AC_MSG_RESULT([ imb : $enable_intf_imb])
|
||||
AC_MSG_RESULT([ bmc : $enable_intf_bmc])
|
||||
AC_MSG_RESULT([ lipmi : $enable_intf_lipmi])
|
||||
AC_MSG_RESULT([ lan : $xenable_intf_lan])
|
||||
AC_MSG_RESULT([ lanplus : $xenable_intf_lanplus])
|
||||
AC_MSG_RESULT([ open : $xenable_intf_open])
|
||||
AC_MSG_RESULT([ free : $xenable_intf_free])
|
||||
AC_MSG_RESULT([ imb : $xenable_intf_imb])
|
||||
AC_MSG_RESULT([ bmc : $xenable_intf_bmc])
|
||||
AC_MSG_RESULT([ lipmi : $xenable_intf_lipmi])
|
||||
AC_MSG_RESULT([ serial : $xenable_intf_serial])
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([Extra tools])
|
||||
AC_MSG_RESULT([ ipmievd : yes])
|
||||
AC_MSG_RESULT([ ipmievd : yes])
|
||||
AC_MSG_RESULT([ ipmishell : $xenable_ipmishell])
|
||||
AC_MSG_RESULT([])
|
||||
|
||||
|
@ -27,15 +27,13 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
dist_pkgdata_DATA = README
|
||||
|
||||
dist_pkgdata_SCRIPTS = bmclanconf ipmi.init.basic ipmi.init.redhat \
|
||||
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh
|
||||
dist_pkgdata_DATA = oem_ibm_sel_map
|
||||
|
||||
EXTRA_DIST = README \
|
||||
bmclanconf ipmi.init.basic ipmi.init.redhat \
|
||||
ipmievd.init.redhat ipmievd.init.suse ipmievd.init.debian \
|
||||
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh \
|
||||
bmc-snmp-proxy bmc-snmp-proxy.service bmc-snmp-proxy.sysconf
|
||||
|
381
ipmitool/contrib/bmc-snmp-proxy
Normal file
381
ipmitool/contrib/bmc-snmp-proxy
Normal file
@ -0,0 +1,381 @@
|
||||
#!/bin/sh
|
||||
#############################################################################
|
||||
#
|
||||
# bmc-snmp-proxy: Set SNMP proxy to BMC (Baseboard Management Controller)
|
||||
#
|
||||
# version: 0.6
|
||||
#
|
||||
# Authors: Charles Rose <charles_rose@dell.com>
|
||||
# Jordan Hargrave <jordan_hargrave@dell.com>
|
||||
#
|
||||
# Description: Script to set snmp proxy to the BMC for certain OID
|
||||
# See here for details:
|
||||
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
|
||||
#
|
||||
# Assumptions: This script will work only when /etc/snmp/ is writable.
|
||||
#
|
||||
#############################################################################
|
||||
# GLOBALS
|
||||
#############################################################################
|
||||
SYSCONF_DIR="/etc/sysconfig"
|
||||
CONFIG="${SYSCONF_DIR}/bmc-snmp-proxy"
|
||||
|
||||
SNMPD_LOCAL_CONF_DIR="/etc/snmp/bmc"
|
||||
SNMPD_LOCAL_CONF="${SNMPD_LOCAL_CONF_DIR}/snmpd.local.conf"
|
||||
TRAPD_LOCAL_CONF="${SNMPD_LOCAL_CONF_DIR}/snmptrapd.local.conf"
|
||||
|
||||
TRAPD_CONF="/etc/snmp/snmptrapd.conf"
|
||||
|
||||
LOCKFILE="/var/lock/subsys/bmc-snmp-proxy"
|
||||
BMC_INFO="/var/run/bmc-info"
|
||||
|
||||
IPMITOOL=`which ipmitool`
|
||||
|
||||
#Default config
|
||||
BMC_COMMUNITY="public"
|
||||
BMC_OID=".1.3.6.1.4.1.674.10892.2" # Dell iDRAC
|
||||
TRAP_FORWARD="no"
|
||||
RELOAD_SERVICES="yes"
|
||||
|
||||
#############################################################################
|
||||
|
||||
#TODO: Use inotify and daemonize when $BMC_INFO changes
|
||||
|
||||
# source config
|
||||
[ -r ${CONFIG} ] && . ${CONFIG}
|
||||
|
||||
. gettext.sh
|
||||
|
||||
SCRIPT_NAME=$(basename $0)
|
||||
RETVAL=0
|
||||
|
||||
# Check if bmc-info created by exchange-bmc-os-info
|
||||
bmc_info_exists()
|
||||
{
|
||||
if [ -r "${BMC_INFO}" ]; then
|
||||
. ${BMC_INFO}
|
||||
else
|
||||
RETVAL=2
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
check_snmp()
|
||||
{
|
||||
if [ ! -d /etc/snmp ] && [ ! -x /usr/sbin/snmpd ]; then
|
||||
RETVAL=12
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
# configure SNMP proxy
|
||||
#############################################################################
|
||||
write_snmp_conf()
|
||||
{
|
||||
# SNMPv3 security: bmcview, bmc_ctx, bmc_sec, bmc_grp, bmc_cmty
|
||||
printf "###############################################\n"
|
||||
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
|
||||
printf "###############################################\n"
|
||||
printf "view bmcview included %s 80\n" "${BMC_OID}"
|
||||
printf "com2sec -Cn bmc_ctx bmc_sec default bmc_cmty\n"
|
||||
printf "group bmc_grp v1 bmc_sec\n"
|
||||
printf "access bmc_grp bmc_ctx any noauth exact bmcview none none\n"
|
||||
printf "proxy -Cn bmc_ctx -v 1 %s\n" "${PROXY_TOKEN}"
|
||||
printf "###############################################\n"
|
||||
}
|
||||
|
||||
valid_ip()
|
||||
{
|
||||
#Thanks to mkyong.com
|
||||
octet="([01]?[[:digit:]][[:digit:]]?|2[0-4][[:digit:]]|25[0-5])"
|
||||
|
||||
printf -- "%s" "${1}"| grep -Eq \
|
||||
"^${octet}\\.${octet}\\.${octet}\\.${octet}$"
|
||||
return $?
|
||||
}
|
||||
|
||||
check_vars()
|
||||
{
|
||||
[ -z ${BMC_COMMUNITY} ] && BMC_COMMUNITY="public"
|
||||
[ -z ${BMC_OID} ] && return 1
|
||||
|
||||
if [ -n "${BMC_IPv4}" ] && valid_ip ${BMC_IPv4}; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
set_snmp_proxy()
|
||||
{
|
||||
if check_vars; then
|
||||
PROXY_TOKEN="-c ${BMC_COMMUNITY} ${BMC_IPv4} ${BMC_OID}"
|
||||
|
||||
if [ ! -d ${SNMPD_LOCAL_CONF_DIR} ] && \
|
||||
mkdir ${SNMPD_LOCAL_CONF_DIR}; then
|
||||
write_snmp_conf > ${SNMPD_LOCAL_CONF}
|
||||
[ $? -ne 0 ] && RETVAL=4
|
||||
fi
|
||||
else
|
||||
RETVAL=3
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
set_snmpd_conf_path()
|
||||
{
|
||||
for SYSCONF in ${SYSCONF_DIR}/snmp*d;
|
||||
do
|
||||
if grep -q "${SNMPD_LOCAL_CONF_DIR}" "${SYSCONF}" > \
|
||||
/dev/null 2>&1; then
|
||||
continue
|
||||
else
|
||||
printf "SNMPCONFPATH=%s\n" "${SNMPD_LOCAL_CONF_DIR}" \
|
||||
>> ${SYSCONF} || RETVAL=7
|
||||
fi
|
||||
done
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
disable_snmp_proxy()
|
||||
{
|
||||
if [ -f ${SNMPD_LOCAL_CONF} ]; then
|
||||
rm -f ${SNMPD_LOCAL_CONF}
|
||||
[ $? -ne 0 ] && RETVAL=5
|
||||
fi
|
||||
}
|
||||
#############################################################################
|
||||
# Trap Forwarding
|
||||
#############################################################################
|
||||
|
||||
pick_alert_dest()
|
||||
{
|
||||
test_ip="$1"
|
||||
for ALERT_DEST in `seq 1 4`
|
||||
do
|
||||
temp_ip=$(${IPMITOOL} lan alert print ${CHANNEL} ${ALERT_DEST}\
|
||||
2>/dev/null| sed -n "s#^Alert IP Address.*: ##p")
|
||||
|
||||
[ "${temp_ip}" = "${test_ip}" ] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
set_alert_dest_ip()
|
||||
{
|
||||
${IPMITOOL} lan alert set ${CHANNEL} ${ALERT_DEST} ipaddr ${1} \
|
||||
retry 4 type pet >/dev/null 2>&1
|
||||
[ $? -ne 0 ] && RETVAL=8
|
||||
}
|
||||
|
||||
bmc_alert_dest()
|
||||
{
|
||||
# Pick the first active LAN channel
|
||||
for CHANNEL in `seq 1 14`
|
||||
do
|
||||
[ $(${IPMI_TOOL} -I open channel info ${CHANNEL} 2>/dev/null \
|
||||
| grep -q "802\.3") ] || break
|
||||
done
|
||||
|
||||
# If TRAPD_IP is already set as an alert dest,
|
||||
if pick_alert_dest "${TRAPD_IP}"; then
|
||||
# reset: reset it if we are called with reset
|
||||
[ "${1}" = "reset" ] && \
|
||||
set_alert_dest_ip "0.0.0.0"
|
||||
# else, find the next free alert dest,
|
||||
elif pick_alert_dest "0.0.0.0"; then
|
||||
[ "${1}" = "reset" ] && \
|
||||
return $RETVAL
|
||||
# set: the TRAPD_IP
|
||||
set_alert_dest_ip "${TRAPD_IP}"
|
||||
else
|
||||
# No free alert destinations
|
||||
RETVAL=9
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
set_ipmi_alert()
|
||||
{
|
||||
${IPMITOOL} lan set ${CHANNEL} alert "${1}" >/dev/null 2>&1
|
||||
[ $? -ne 0 ] && RETVAL=10
|
||||
}
|
||||
|
||||
get_host_ip()
|
||||
{
|
||||
# Get host's IP that the BMC can reach.
|
||||
IFACE=$(/usr/sbin/ip -o -f inet address |awk '!/: lo/ {print $2}')
|
||||
for dev in ${IFACE}
|
||||
do
|
||||
ping -c 1 -I ${dev} ${BMC_IPv4} > /dev/null 2>&1
|
||||
done
|
||||
}
|
||||
|
||||
config_bmc_alert()
|
||||
{
|
||||
# Get Host's IP that the BMC can send traps to
|
||||
TRAPD_IP=$(get_host_ip)
|
||||
|
||||
# Set Host's IP as the alert destination in the BMC
|
||||
valid_ip ${TRAPD_IP} && bmc_alert_dest "${ACTION}"
|
||||
|
||||
# Enable alerting on the LAN channel
|
||||
[ $RETVAL -eq 0 ] && set_ipmi_alert "${ACTION}"
|
||||
}
|
||||
|
||||
write_trapd_conf()
|
||||
{
|
||||
printf "###############################################\n"
|
||||
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
|
||||
printf "forward %s %s\n" "${BMC_OID}*" "${FORWARD_HOST}"
|
||||
printf "###############################################\n"
|
||||
}
|
||||
|
||||
config_trapd()
|
||||
{
|
||||
# Proceed only if snmptrapd is available on the system
|
||||
if [ -f ${TRAPD_CONF} ]; then
|
||||
write_trapd_conf > ${TRAPD_LOCAL_CONF}
|
||||
[ $? -ne 0 ] && RETVAL=11
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
trap_sink_exists()
|
||||
{
|
||||
# TODO: We only set the first match. We should be able to set
|
||||
# multiple
|
||||
FORWARD_HOST=$(awk '/^trap.*sink/{print $2}; /^informsink/{print $2}' \
|
||||
/etc/snmp/snmpd*conf | head -1)
|
||||
if [ -z "${FORWARD_HOST}" ]; then
|
||||
# there is no trapsink setup.
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Forward SNMP traps from the BMC to trapsink.
|
||||
trap_forward()
|
||||
{
|
||||
NO_TRAP=0
|
||||
ACTION=${1} # set or reset
|
||||
|
||||
if [ "${ACTION}" = "set" ]; then
|
||||
# Get trapd config,
|
||||
if trap_sink_exists; then
|
||||
config_trapd && config_bmc_alert
|
||||
else
|
||||
# exit silently if there is no sink
|
||||
NO_TRAP=1
|
||||
fi
|
||||
else
|
||||
if [ -f ${TRAPD_LOCAL_CONF} ]; then
|
||||
rm -f ${TRAPD_LOCAL_CONF} >/dev/null 2>&1
|
||||
else
|
||||
NO_TRAP=1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
service_reload()
|
||||
{
|
||||
#TODO: do this in systemd
|
||||
if [ ${RETVAL} -eq 0 ] && [ "${RELOAD_SERVICES}" = "yes" ]; then
|
||||
service $1 reload
|
||||
[ $? -ne 0 ] && RETVAL=6
|
||||
fi
|
||||
return
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
start()
|
||||
{
|
||||
if bmc_info_exists && check_snmp; then
|
||||
touch ${LOCKFILE}
|
||||
set_snmpd_conf_path && set_snmp_proxy
|
||||
[ $RETVAL -eq 0 ] && service_reload snmpd
|
||||
|
||||
if [ "${TRAP_FORWARD}" = "yes" ]; then
|
||||
trap_forward "set"
|
||||
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
|
||||
service_reload snmptrapd
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
stop()
|
||||
{
|
||||
[ ! -f ${LOCKFILE} ] && return
|
||||
if bmc_info_exists && check_snmp; then
|
||||
disable_snmp_proxy
|
||||
[ $RETVAL -eq 0 ] && service_reload snmpd
|
||||
|
||||
if [ "${TRAP_FORWARD}" = "yes" ]; then
|
||||
trap_forward "reset"
|
||||
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
|
||||
service_reload snmptrapd
|
||||
fi
|
||||
rm -f ${LOCKFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
status()
|
||||
{
|
||||
eval_gettext "${SCRIPT_NAME}: snmp proxy to BMC is "
|
||||
# Checking for lockfile is better.
|
||||
#if grep -q "^proxy" "${SNMPD_LOCAL_CONF}" > /dev/null 2>&1 ; then
|
||||
if [ -f ${LOCKFILE} ]; then
|
||||
eval_gettext "set"
|
||||
else
|
||||
eval_gettext "not set"
|
||||
fi
|
||||
echo
|
||||
RETVAL=0
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
usage()
|
||||
{
|
||||
eval_gettext "Usage: $0 {start|stop|status}"; echo 1>&2
|
||||
RETVAL=1
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
# MAIN
|
||||
#############################################################################
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
status) status ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
|
||||
case "$RETVAL" in
|
||||
0|1) ;;
|
||||
2) eval_gettext "${SCRIPT_NAME}: failed to read ${BMC_INFO} " 1>&2 ;;
|
||||
3) eval_gettext "${SCRIPT_NAME}: failed to get proxy config." 1>&2 ;;
|
||||
4) eval_gettext "${SCRIPT_NAME}: failed to set ${SNMPD_LOCAL_CONF}." 1>&2 ;;
|
||||
5) eval_gettext "${SCRIPT_NAME}: failed to disable snmp proxy." 1>&2 ;;
|
||||
6) eval_gettext "${SCRIPT_NAME}: failed to reload snmpd." 1>&2 ;;
|
||||
7) eval_gettext "${SCRIPT_NAME}: failed to update ${SYSCONF}." 1>&2 ;;
|
||||
8) eval_gettext "${SCRIPT_NAME}: failed to set IPMI alert dest." 1>&2 ;;
|
||||
9) eval_gettext "${SCRIPT_NAME}: no free IPMI alert dest." 1>&2 ;;
|
||||
10) eval_gettext "${SCRIPT_NAME}: failed to set IPMI PEF." 1>&2 ;;
|
||||
11) eval_gettext "${SCRIPT_NAME}: failed to write snmptrapd.conf." 1>&2 ;;
|
||||
12) eval_gettext "${SCRIPT_NAME}: snmpd not found." 1>&2 ;;
|
||||
*) eval_gettext "${SCRIPT_NAME}: unknown error." 1>&2 ;;
|
||||
esac
|
||||
|
||||
if [ ${RETVAL} -gt 1 ]; then
|
||||
eval_gettext " Return code: ${RETVAL}"; echo
|
||||
fi
|
||||
exit ${RETVAL}
|
||||
#############################################################################
|
||||
# end of file
|
||||
#############################################################################
|
18
ipmitool/contrib/bmc-snmp-proxy.service
Normal file
18
ipmitool/contrib/bmc-snmp-proxy.service
Normal file
@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=Setup SNMP proxy to BMC
|
||||
|
||||
After=exchange-bmc-os-info.service
|
||||
Requires=exchange-bmc-os-info.service
|
||||
PartOf=exchange-bmc-os-info.service
|
||||
|
||||
ConditionPathExists=/var/run/bmc-info
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
ExecStart=/usr/libexec/bmc-snmp-proxy start
|
||||
ExecStop=/usr/libexec/bmc-snmp-proxy stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
48
ipmitool/contrib/bmc-snmp-proxy.sysconf
Normal file
48
ipmitool/contrib/bmc-snmp-proxy.sysconf
Normal file
@ -0,0 +1,48 @@
|
||||
# bmc-snmp-proxy
|
||||
#
|
||||
# Config file to control SNMP redirection between
|
||||
# the OS and Service Processor/Baseboard Management Controller (BMC)
|
||||
#
|
||||
# bmc-snnmp-proxy helps redirect certain SNMP requests (to this host)
|
||||
# destined to the Service Processor. We will need the Service Processor's
|
||||
# SNMP community string and the OID of the Service Processor's SNMP agent.
|
||||
#
|
||||
# For redirecting Traps from the Service Processor to the trap sink
|
||||
# configured in the host (this system), we will have to set
|
||||
# TRAP_FORWARD below.
|
||||
#
|
||||
# See here for details
|
||||
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
|
||||
|
||||
### Configure SNMP proxy to BMC/Service Processor ###
|
||||
|
||||
### Service Processor/BMC SNMP Community String.
|
||||
# Name: BMC_COMMUNITY
|
||||
# Description: Set community string of the Service Processor (BMC)'s
|
||||
# SNMP agent.
|
||||
# Default: public
|
||||
#
|
||||
BMC_COMMUNITY="public"
|
||||
|
||||
### OEM Specific OID of Service Processor
|
||||
# Name: BMC_OID
|
||||
# Description: SNMP OID that we would like to redirect to the Service
|
||||
# Processor (BMC). This can be unique to each OEM.
|
||||
# Default: ".1.3.6.1.4.1.674.10892.2"
|
||||
BMC_OID=".1.3.6.1.4.1.674.10892.2" # Dell iDRAC
|
||||
|
||||
### Forward Traps from the Service Processor to trap sink
|
||||
# Name: TRAP_FORWARD
|
||||
# Description: Enabling this will allow traps from the Service Processor
|
||||
# to be directed to this system and configure snmptrapd
|
||||
# Note: This option will have no effect if trap sink on the system is
|
||||
# not configured
|
||||
# Default: "no"
|
||||
TRAP_FORWARD="yes"
|
||||
|
||||
### Reload snmpd and snmptrapd
|
||||
# Name: RELOAD_SERVICES
|
||||
# Description: Reload snmpd and snmptrapd after making changes to their config
|
||||
# files.
|
||||
# Default: "yes"
|
||||
RELOAD_SERVICES="yes"
|
@ -29,11 +29,6 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
#
|
||||
|
||||
|
||||
# This script is designed for Sun Fire LX50, V60x and V65x systems.
|
||||
|
@ -5,7 +5,7 @@ echo "Setting up OpenIPMI driver..."
|
||||
# load the ipmi modules
|
||||
modprobe ipmi_msghandler
|
||||
modprobe ipmi_devintf
|
||||
if ! modprobe ipmi_kcs_drv ; then
|
||||
if ! modprobe ipmi_si_drv ; then
|
||||
modprobe ipmi_si # try new module name
|
||||
fi
|
||||
|
||||
|
@ -38,7 +38,7 @@ start() {
|
||||
# module if that fails.
|
||||
if ! /sbin/modprobe ipmi_si >/dev/null 2>&1
|
||||
then
|
||||
/sbin/modprobe ipmi_kcs_drv || RETVAL=1
|
||||
/sbin/modprobe ipmi_si_drv || RETVAL=1
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -173,7 +173,7 @@ remove () {
|
||||
then
|
||||
# Try removing both 2.4 and 2.6 modules.
|
||||
/sbin/rmmod ipmi_si 2>/dev/null
|
||||
/sbin/rmmod ipmi_kcs_drv 2>/dev/null
|
||||
/sbin/rmmod ipmi_si_drv 2>/dev/null
|
||||
/sbin/rmmod ipmi_devintf
|
||||
/sbin/rmmod ipmi_msghandler
|
||||
else
|
||||
|
92
ipmitool/contrib/ipmievd.init.debian
Executable file
92
ipmitool/contrib/ipmievd.init.debian
Executable file
@ -0,0 +1,92 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $local_fs $remote_fs $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: S 0 1 6
|
||||
# Short-Description: IPMI event daemon
|
||||
# Description: ipmievd is a daemon which will listen for events
|
||||
# from the BMC that are being sent to the SEL and
|
||||
# also log those messages to syslog.
|
||||
### END INIT INFO
|
||||
#
|
||||
# Author: Elmar Hoffmann <elho@elho.net>
|
||||
# Licence: This script is public domain using the same
|
||||
# licence as ipmitool itself.
|
||||
# Modified by: Petter Reinholdtsen
|
||||
|
||||
set -e
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="IPMI event daemon"
|
||||
NAME=ipmievd
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /etc/default/rcS
|
||||
|
||||
# Options used by ipmievd.
|
||||
#
|
||||
# "open" uses the asynchronous event notification from the OpenIPMI
|
||||
# kernel driver, "sel" uses active polling of the contents of the SEL
|
||||
# for new events.
|
||||
#
|
||||
# Need to force 'daemon' mode, to make sure messages are sent to
|
||||
# syslog and the program forks into the background.
|
||||
#
|
||||
# Se ipmievd(8) for more info.
|
||||
IPMIEVD_OPTIONS="open daemon"
|
||||
|
||||
# Read config file if it is present.
|
||||
[ -f /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service.
|
||||
#
|
||||
d_start() {
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- $IPMIEVD_OPTIONS
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service.
|
||||
#
|
||||
d_stop() {
|
||||
start-stop-daemon --stop --quiet --name $NAME --exec $DAEMON
|
||||
}
|
||||
|
||||
CODE=0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
|
||||
d_start || CODE=$?
|
||||
[ "$VERBOSE" != no ] && log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
stop)
|
||||
log_begin_msg "Stopping $DESC" "$NAME"
|
||||
d_stop || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_begin_msg "Restarting $DESC" "$NAME"
|
||||
d_stop || true
|
||||
sleep 1
|
||||
d_start || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
87
ipmitool/contrib/ipmievd.init.redhat
Executable file
87
ipmitool/contrib/ipmievd.init.redhat
Executable file
@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# /etc/rc.d/init.d/ipmievd
|
||||
#
|
||||
# Based on example sysvinitfiles script
|
||||
# Copyright (c) 2000 Red Hat Software, Inc.
|
||||
#
|
||||
# chkconfig: 345 99 00
|
||||
# description: ipmievd daemon to send events to syslog
|
||||
# processname: ipmievd
|
||||
# config: /etc/sysconfig/ipmievd
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $syslog ipmi
|
||||
# Should-Start: $time
|
||||
# Required-Stop: $syslog ipmi
|
||||
# Should-Stop: $time
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: ipmievd daemon to send events to syslog
|
||||
# Description: Start ipmievd to read events from BMC and
|
||||
# log them to syslog. Events correspond to hardware faults,
|
||||
# state transitions such as power on and off, and sensor
|
||||
# readings such as temperature, voltage and fan speed that
|
||||
# are abnormal.
|
||||
### END INIT INFO
|
||||
|
||||
IPMIEVD_BIN=/usr/sbin/ipmievd
|
||||
test -x $IPMIEVD_BIN || { echo "$IPMIEVD_BIN not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
# Check for existence of needed config file
|
||||
IPMIEVD_CONFIG=/etc/sysconfig/ipmievd
|
||||
test -r $IPMIEVD_CONFIG || { echo "$IPMIEVD_CONFIG does not exist";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 6; fi; }
|
||||
|
||||
# Read config file
|
||||
. $IPMIEVD_CONFIG
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
start() {
|
||||
echo "Starting ipmievd:"
|
||||
if [ -f /var/lock/subsys/ipmievd ]; then
|
||||
return 0
|
||||
fi
|
||||
daemon $IPMIEVD_BIN $IPMIEVD_OPTIONS
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && touch /var/lock/subsys/ipmievd
|
||||
return $ret
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Shutting down ipmievd:"
|
||||
killproc $IPMIEVD_BIN
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && rm -f /var/lock/subsys/ipmievd
|
||||
return $ret
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status $IPMIEVD_BIN
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
condrestart)
|
||||
[ -f /var/lock/subsys/ipmievd ] && restart || :
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ipmievd {start|stop|status|reload|restart|condrestart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit $?
|
212
ipmitool/contrib/ipmievd.init.suse
Executable file
212
ipmitool/contrib/ipmievd.init.suse
Executable file
@ -0,0 +1,212 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# System startup script for ipmievd
|
||||
# Based on skeleton.compat example script
|
||||
# Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
#
|
||||
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
|
||||
# UnitedLinux/SUSE/Novell based Linux distributions. However, it will work
|
||||
# on other distributions as well, by using the LSB (Linux Standard Base)
|
||||
# or RH functions or by open coding the needed functions.
|
||||
# Read http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/ if you prefer not
|
||||
# to use this template.
|
||||
#
|
||||
# chkconfig: 345 99 00
|
||||
# description: ipmievd daemon
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $syslog ipmi
|
||||
# Should-Start: $time
|
||||
# Required-Stop: $syslog ipmi
|
||||
# Should-Stop: $time
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: ipmievd daemon to send events to syslog
|
||||
# Description: Start ipmievd to read events from BMC and
|
||||
# log them to syslog. Events correspond to hardware faults,
|
||||
# state transitions such as power on and off, and sensor
|
||||
# readings such as temperature, voltage and fan speed that
|
||||
# are abnormal.
|
||||
### END INIT INFO
|
||||
#
|
||||
|
||||
# Check for missing binaries (stale symlinks should not happen)
|
||||
# Note: Special treatment of stop for LSB conformance
|
||||
IPMIEVD_BIN=/usr/sbin/ipmievd
|
||||
test -x $IPMIEVD_BIN || { echo "$IPMIEVD_BIN not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
# Check for existence of needed config file and read it
|
||||
IPMIEVD_CONFIG=/etc/sysconfig/ipmievd
|
||||
test -r $IPMIEVD_CONFIG || { echo "$IPMIEVD_CONFIG does not exist";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 6; fi; }
|
||||
|
||||
# Read config
|
||||
. $IPMIEVD_CONFIG
|
||||
|
||||
if test -e /etc/rc.status; then
|
||||
# SUSE rc script library
|
||||
. /etc/rc.status
|
||||
else
|
||||
export LC_ALL=POSIX
|
||||
_cmd=$1
|
||||
declare -a _SMSG
|
||||
if test "${_cmd}" = "status"; then
|
||||
_SMSG=(running dead dead unused unknown reserved)
|
||||
_RC_UNUSED=3
|
||||
else
|
||||
_SMSG=(done failed failed missed failed skipped unused failed failed reserved)
|
||||
_RC_UNUSED=6
|
||||
fi
|
||||
if test -e /lib/lsb/init-functions; then
|
||||
# LSB
|
||||
. /lib/lsb/init-functions
|
||||
echo_rc()
|
||||
{
|
||||
if test ${_RC_RV} = 0; then
|
||||
log_success_msg " [${_SMSG[${_RC_RV}]}] "
|
||||
else
|
||||
log_failure_msg " [${_SMSG[${_RC_RV}]}] "
|
||||
fi
|
||||
}
|
||||
# TODO: Add checking for lockfiles
|
||||
checkproc() { return pidofproc ${1+"$@"} >/dev/null 2>&1; }
|
||||
elif test -e /etc/init.d/functions; then
|
||||
# RHAT
|
||||
. /etc/init.d/functions
|
||||
echo_rc()
|
||||
{
|
||||
#echo -n " [${_SMSG[${_RC_RV}]}] "
|
||||
if test ${_RC_RV} = 0; then
|
||||
success " [${_SMSG[${_RC_RV}]}] "
|
||||
else
|
||||
failure " [${_SMSG[${_RC_RV}]}] "
|
||||
fi
|
||||
}
|
||||
checkproc() { return status ${1+"$@"}; }
|
||||
start_daemon() { return daemon ${1+"$@"}; }
|
||||
else
|
||||
# emulate it
|
||||
echo_rc() { echo " [${_SMSG[${_RC_RV}]}] "; }
|
||||
fi
|
||||
rc_reset() { _RC_RV=0; }
|
||||
rc_failed()
|
||||
{
|
||||
if test -z "$1"; then
|
||||
_RC_RV=1;
|
||||
elif test "$1" != "0"; then
|
||||
_RC_RV=$1;
|
||||
fi
|
||||
return ${_RC_RV}
|
||||
}
|
||||
rc_check()
|
||||
{
|
||||
return rc_failed $?
|
||||
}
|
||||
rc_status()
|
||||
{
|
||||
rc_failed $?
|
||||
if test "$1" = "-r"; then _RC_RV=0; shift; fi
|
||||
if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
|
||||
if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi
|
||||
if test "$1" = "-v"; then echo_rc; shift; fi
|
||||
if test "$1" = "-r"; then _RC_RV=0; shift; fi
|
||||
return ${_RC_RV}
|
||||
}
|
||||
rc_exit() { exit ${_RC_RV}; }
|
||||
rc_active()
|
||||
{
|
||||
if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
|
||||
if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
|
||||
return 1
|
||||
}
|
||||
fi
|
||||
|
||||
# Reset status of this service
|
||||
rc_reset
|
||||
|
||||
# Return values acc. to LSB for all commands but status:
|
||||
# 0 - success
|
||||
# 1 - generic or unspecified error
|
||||
# 2 - invalid or excess argument(s)
|
||||
# 3 - unimplemented feature (e.g. "reload")
|
||||
# 4 - user had insufficient privileges
|
||||
# 5 - program is not installed
|
||||
# 6 - program is not configured
|
||||
# 7 - program is not running
|
||||
# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
|
||||
#
|
||||
# Note that starting an already running service, stopping
|
||||
# or restarting a not-running service as well as the restart
|
||||
# with force-reload (in case signaling is not supported) are
|
||||
# considered a success.
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting ipmievd "
|
||||
start_daemon $IPMIEVD_BIN $IPMIEVD_OPTIONS
|
||||
rc_status -v
|
||||
;;
|
||||
stop)
|
||||
echo -n "Shutting down ipmievd "
|
||||
killproc -TERM $IPMIEVD_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
try-restart|condrestart)
|
||||
## Do a restart only if the service was active before.
|
||||
## Note: try-restart is now part of LSB (as of 1.9).
|
||||
## RH has a similar command named condrestart.
|
||||
if test "$1" = "condrestart"; then
|
||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
||||
fi
|
||||
$0 status
|
||||
if test $? = 0; then
|
||||
$0 restart
|
||||
else
|
||||
rc_reset # Not running is not a failure.
|
||||
fi
|
||||
rc_status
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
rc_status
|
||||
;;
|
||||
force-reload)
|
||||
echo -n "Reload service ipmievd "
|
||||
$0 try-restart
|
||||
rc_status
|
||||
;;
|
||||
reload)
|
||||
rc_failed 3
|
||||
rc_status -v
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for service ipmievd "
|
||||
checkproc $IPMIEVD_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload| reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
229
ipmitool/contrib/oem_ibm_sel_map
Normal file
229
ipmitool/contrib/oem_ibm_sel_map
Normal file
@ -0,0 +1,229 @@
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","Chassis Number","R","R","0x00","CPU shutdown - Potential cause "triple fault" a software address problem"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x01","Chassis Number","Failed Memory Card","Spare Memory Card","0x00","Memory Mirrored Failover Occurred - System running from mirrored memory image"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x04","Chassis Number","Memory Card","Completion Code (0x00=Success)","0x00","Memory hot replace event"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x05","Chassis Number","Memory Card","Memory Size (in 512MB units)","0x00","Memory hot add event"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x00","Chassis Number","Scalability Port Number","R","0x00","Scalability link down"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","Chassis Number","Scalability Port Number","R","0x00","Scalability link up"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x02","Chassis Number","Scalability Port Number","R","0x00","Scalability link double wide down"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x03","Chassis Number","Scalability Port Number","R","0x00","Scalability link double wide up"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x80","Chassis Number","Scalability Port Number","R","0x00","Scalability link PFA"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x81","Chassis Number","Scalability Port Number","R","0x00","Scalability link invalid port"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x82","Chassis Number","Scalability Port Number","R","0x00","Scalability link invalid node"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x83","Chassis Number","Scalability Port Number","R","0x00","Scalability link kill"
|
||||
"0xE0","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Device OK"
|
||||
"0xE0","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required ROM space not available"
|
||||
"0xE0","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space not available"
|
||||
"0xE0","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required memory not available"
|
||||
"0xE0","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required memory below 1MB not available"
|
||||
"0xE0","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","ROM checksum failed"
|
||||
"0xE0","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","BIST failed"
|
||||
"0xE0","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Planar device missing or disabled by user"
|
||||
"0xE0","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","PCI device has an invalid PCI configuration space header"
|
||||
"0xE0","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for added PCI device"
|
||||
"0xE0","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for removed PCI device"
|
||||
"0xE0","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was removed, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was added, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Requested resources not available"
|
||||
"0xE0","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Planar video disabled due to add in video card"
|
||||
"0xE0","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for PCI device partially disabled "
|
||||
"0xE0","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was partially disabled, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A 33Mhz device is installed on a 66Mhz bus, PCI device information is stored in next log entry"
|
||||
"0xE0","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information, 33Mhz device installed on 66Mhz bus"
|
||||
"0xE0","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Merge cable missing"
|
||||
"0xE0","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 1 to Node 2 cable missing"
|
||||
"0xE0","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 1 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 2 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Nodes could not merge"
|
||||
"0xE0","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","No 8 way SMP cable"
|
||||
"0xE0","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Primary North Bridge to PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Redundant PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Device OK"
|
||||
"0xE0","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required ROM space not available"
|
||||
"0xE0","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space not available"
|
||||
"0xE0","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required memory not available"
|
||||
"0xE0","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required memory below 1MB not available"
|
||||
"0xE0","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","ROM checksum failed"
|
||||
"0xE0","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","BIST failed"
|
||||
"0xE0","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Planar device missing or disabled by user"
|
||||
"0xE0","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","PCI device has an invalid PCI configuration space header"
|
||||
"0xE0","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for added PCI device"
|
||||
"0xE0","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for removed PCI device"
|
||||
"0xE0","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was added, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was removed, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Requested resources not available"
|
||||
"0xE0","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Planar video disabled due to add in video card"
|
||||
"0xE0","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for PCI device partially disabled "
|
||||
"0xE0","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was partially disabled, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A 33Mhz device is installed on a 66Mhz bus, PCI device information is stored in next log entry"
|
||||
"0xE0","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information, 33Mhz device installed on 66Mhz bus"
|
||||
"0xE0","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Merge cable missing"
|
||||
"0xE0","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 1 to Node 2 cable missing"
|
||||
"0xE0","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 1 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 2 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Nodes could not merge"
|
||||
"0xE0","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","No 8 way SMP cable"
|
||||
"0xE0","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Primary North Bridge to PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Redundant PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x01","0x00","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","Processor has failed BIST"
|
||||
"0xE0","0x01","0x01","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","Unable to apply processor microcode update"
|
||||
"0xE0","0x01","0x02","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","POST does not support current stepping level of processor"
|
||||
"0xE0","0x01","0x03","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","CPU mismatch detected"
|
||||
"0xE0","0x01","0x04","Chassis Number","R","R","R","R","R","R","R","R","R","0x00","Invalid configuration of processor card."
|
||||
"0xE0","0x02","0x00","Chassis Number","Memory Card","Memory DIMM","R","R","R","R","R","R","R","0x00","Uncorrectable memory error occurred"
|
||||
"0xE0","0x02","0x01","Chassis Number","Memory Card","Memory DIMM","Failing Symbol","R","R","R","R","R","R","0x00","Correctable memory threshold occurred"
|
||||
"0xE0","0x02","0x02","0x00","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM enabled"
|
||||
"0xE0","0x02","0x02","0x01","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, failed ECC test"
|
||||
"0xE0","0x02","0x02","0x02","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, failed POST/BIOS memory test"
|
||||
"0xE0","0x02","0x02","0x03","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, non-supported memory device"
|
||||
"0xE0","0x02","0x02","0x04","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, non-matching or missing DIMM(s)"
|
||||
"0xE0","0x02","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","0x00","Memory card enabled"
|
||||
"0xE0","0x02","0x03","0x01","Chassis Number","Memory Card","R","R","R","R","R","R","R","0x00","Memory card disabled"
|
||||
"0xE0","0x02","0x00","0x00","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM enabled"
|
||||
"0xE0","0x02","0x00","0x01","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, failed ECC test"
|
||||
"0xE0","0x02","0x00","0x02","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, failed POST/BIOS memory test"
|
||||
"0xE0","0x02","0x00","0x03","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, non-supported memory device"
|
||||
"0xE0","0x02","0x00","0x04","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, non-matching or missing DIMM(s)"
|
||||
"0xE0","0x02","0x00","0x05","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, multi-bit or multi-symbol error"
|
||||
"0xE0","0x02","0x01","0x00","Chassis","Failed Channel","R","R","R","R","R","R","R","0x01","AMB Failure Detected on Channel X During Last Boot"
|
||||
"0xE1","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","Unknown SERR/PERR detected on PCI bus"
|
||||
"0xE1","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Address of special cycle DPE"
|
||||
"0xE1","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Master read parity error"
|
||||
"0xE1","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received target parity error"
|
||||
"0xE1","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Master write parity error"
|
||||
"0xE1","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Device signaled SERR"
|
||||
"0xE1","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Slave signaled parity error"
|
||||
"0xE1","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Signaled Target Abort"
|
||||
"0xE1","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: Additional Correctable ECC Error"
|
||||
"0xE1","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received Master Abort"
|
||||
"0xE1","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Additional Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Split Completion Discarded"
|
||||
"0xE1","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: Correctable ECC Error"
|
||||
"0xE1","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unexpected Split Completion"
|
||||
"0xE1","0x00","0x0E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x0F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received split completion error"
|
||||
"0xE1","0x00","0x11","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Address of special cycle DPE"
|
||||
"0xE1","0x00","0x12","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Master read parity error"
|
||||
"0xE1","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received target parity error"
|
||||
"0xE1","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Master write parity error"
|
||||
"0xE1","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Device Signaled SERR"
|
||||
"0xE1","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Slave Signaled Parity Error"
|
||||
"0xE1","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Signaled Target Abort"
|
||||
"0xE1","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: PCI-PCI bridge secondary error: Additional Correctable ECC Error"
|
||||
"0xE1","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received Master Abort"
|
||||
"0xE1","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Additional Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Split Completion Discarded"
|
||||
"0xE1","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: PCI-PCI bridge secondary error: Correctable ECC Error"
|
||||
"0xE1","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Unexpected Split Completion"
|
||||
"0xE1","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received split completion error"
|
||||
"0xE1","0x00","0x20","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: PCI ECC Error (Corrected)"
|
||||
"0xE1","0x00","0x21","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Bus Address Parity Error"
|
||||
"0xE1","0x00","0x22","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Bus Data Parity Error"
|
||||
"0xE1","0x00","0x23","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: SERR# Asserted"
|
||||
"0xE1","0x00","0x24","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PERR Received by Calgary on a PCIX Split Completion"
|
||||
"0xE1","0x00","0x25","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Address"
|
||||
"0xE1","0x00","0x27","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: TCE Extent Error"
|
||||
"0xE1","0x00","0x29","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Page Fault"
|
||||
"0xE1","0x00","0x2B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unauthorized Access"
|
||||
"0xE1","0x00","0x2D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Parity Error in DMA Read Data Buffer"
|
||||
"0xE1","0x00","0x2F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Bus Time Out"
|
||||
"0xE1","0x00","0x31","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Delayed Read Timeout"
|
||||
"0xE1","0x00","0x33","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal Error on PCIX Split Completion"
|
||||
"0xE1","0x00","0x35","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Read Reply (RIO) Timeout"
|
||||
"0xE1","0x00","0x37","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on DMA Write"
|
||||
"0xE1","0x00","0x39","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: MVE Valid Bit Off"
|
||||
"0xE1","0x00","0x3B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: MVE Index Invalid"
|
||||
"0xE1","0x00","0x40","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: ECC Error (Corrected)"
|
||||
"0xE1","0x00","0x41","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: SERR# Detected"
|
||||
"0xE1","0x00","0x42","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Bus Data Parity Error"
|
||||
"0xE1","0x00","0x43","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: No DEVSEL#"
|
||||
"0xE1","0x00","0x45","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Bus Time Out"
|
||||
"0xE1","0x00","0x47","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Retry Count Expired"
|
||||
"0xE1","0x00","0x49","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Target-Abort"
|
||||
"0xE1","0x00","0x4B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Size"
|
||||
"0xE1","0x00","0x4D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Access Not Enabled"
|
||||
"0xE1","0x00","0x4F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on MMIO Store"
|
||||
"0xE1","0x00","0x51","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Split Response Received"
|
||||
"0xE1","0x00","0x53","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Split Completion Error Status Received"
|
||||
"0xE1","0x00","0x55","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unexpected PCIX Split Completion Received"
|
||||
"0xE1","0x00","0x57","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Split Completion Timeout"
|
||||
"0xE1","0x00","0x59","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Recoverable Error Summary Bit"
|
||||
"0xE1","0x00","0x5B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: CSR Error Summary Bit"
|
||||
"0xE1","0x00","0x5D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on MMIO Load"
|
||||
"0xE1","0x00","0x61","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Bad Command"
|
||||
"0xE1","0x00","0x63","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Length Field Invalid"
|
||||
"0xE1","0x00","0x65","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Load Greater Than 8 & No Write Buffer Enabled"
|
||||
"0xE1","0x00","0x67","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Discontiguous Byte Enable Error"
|
||||
"0xE1","0x00","0x69","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: 4K Address Boundary Crossing Error"
|
||||
"0xE1","0x00","0x6B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Store Wrap State Machine Check"
|
||||
"0xE1","0x00","0x6D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Target State Machine Check"
|
||||
"0xE1","0x00","0x6F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PM/DW"
|
||||
"0xE1","0x00","0x71","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PM/DR"
|
||||
"0xE1","0x00","0x73","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PS/DW"
|
||||
"0xE1","0x00","0x75","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Write Command FIFO Parity Error"
|
||||
"0xE1","0x00","0x76","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Secondary Status Register Dump"
|
||||
"0xE1","0x00","0x77","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Secondary Status Register Dump"
|
||||
"0xE1","0x00","0x81","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PCI-to-PCI Bridge Discard Timer Error"
|
||||
"0xE1","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x01","SERR detected on PCI bus"
|
||||
"0xE1","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x01","PERR detected on PCI bus"
|
||||
"0xE1","0x01","0x00","R","R","Bank (LSB)","Bank (MSB)","Apic ID (LSB)","Apic ID (MSB)","CK4(LSB)","CK4","CK4","CK4(MSB)","0x00","Processor Error Information Data A"
|
||||
"0xE1","0x01","0x01","R","R","Address high (LSB)","Address high","Address high","Address high (MSB)","Address low (LSB)","Address low ","Address low ","Address low (MSB)","0x00","Processor Error Information Data B1"
|
||||
"0xE1","0x01","0x02","R","R","Timestamp high (LSB)","Timestamp high","Timestamp high","Timestamp high (MSB)","Timestamp Low (LSB)","Timestamp low","Timestamp low","Timestamp low (MSB)","0x00","Processor Error Information Data B2"
|
||||
"0xE1","0x01","0x03","R","R","MCA status register high (LSB)","MCA status register high","MCA status register high","MCA status register high (MSB)","MCA status register low (LSB)","MCA status register low","MCA status register low","MCA status register low (MSB)","0x00","Processor Error Information Data C"
|
||||
"0xE1","0x01","0x04","Chassis","0x00","Processor ID","R","R","R","R","R","R","R","0x00","Processor recoverable error"
|
||||
"0xE1","0x01","0x04","Chassis","0x01","Processor ID","R","R","R","R","R","R","R","0x00","Processor unrecoverable error"
|
||||
"0xE1","0x02","0x00","0x00","Failed Row","Spare Row","R","R","R","R","R","R","R","0x00","Memory sparing event, start 1"
|
||||
"0xE1","0x02","0x00","0x02","Failed Row","Spare Row","R","R","R","R","R","R","R","0x00","Memory sparing event, done 1"
|
||||
"0xE1","0x02","0x00","0x01","Failed Row 1","Failed Row 2","Spare Row 1","Spare Row 2","R","R","R","R","R","0x00","Memory sparing event, start 2"
|
||||
"0xE1","0x02","0x00","0x03","Failed Row 1","Failed Row 2","Spare Row 1","Spare Row 2","R","R","R","R","R","0x00","Memory sparing event, done 2"
|
||||
"0xE1","0x02","0x01","Failed Port","Spare Port","R","R","R","R","R","R","R","R","0x00","Memory mirroring failover occurred"
|
||||
"0xE1","0x02","0x00","0x00","R","R","R","R","R","R","R","R","R","0x01","Memory sparing event, start 1"
|
||||
"0xE1","0x02","0x00","0x02","R","R","R","R","R","R","R","R","R","0x01","Memory sparing event, done 1"
|
||||
"0xE1","0x04","0x00","0x00","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB A Fatal"
|
||||
"0xE1","0x04","0x00","0x01","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB A Nonfatal"
|
||||
"0xE1","0x04","0x00","0x02","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB B Fatal"
|
||||
"0xE1","0x04","0x00","0x03","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB B Nonfatal"
|
||||
"0xE1","0x05","0x00","0x02","Hi FERR or NERR Register","R","R","R","R","R","R","R","R","0x00","Lindenhurst Chipset Event: Hi Fatal"
|
||||
"0xE1","0x05","0x00","0x03","Hi FERR or NERR Register","R","R","R","R","R","R","R","R","0x00","Lindenhurst Chipset Event: Hi Nonfatal"
|
||||
"0xE1","0x05","0x01","0x02","Status Register Contents","R","R","R","R","R","R","R","R","0x00","Fatal internal north bridge error"
|
||||
"0xE1","0x05","0x01","0x03","Status Register Contents","R","R","R","R","R","R","R","R","0x00","Nonfatal internal north bridge error"
|
||||
"0xE1","0x05","0x01","0x04","Bus","Device","Function Number","R","R","R","R","R","R","0x00","Link Degrade Event"
|
||||
"0xE1","0x05","0x01","0x05","R","R","R","R","R","R","R","R","R","0x00","Spurious Memory Event"
|
||||
"0xE2","0x00","Register ID","R","First Fire Bit (0xFF=N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI Industry Standard Register Dump"
|
||||
"0xE2","0x01","Register ID","R","First Fire Bit (0xFF if N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI-X Industry Standard Register Dump"
|
||||
"0xE2","0x02","Register ID","R","First Fire Bit (0xFF if N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI Express Industry Standard Register Dump"
|
||||
"0xE3","Platform ID","Register ID","R","R","R","R","R","R","Register Data (LSB)","Register Data","Register Data","Register Data (MSB)","0x00","RAW Hex Dump"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x00","0x00","R","R","R","0x00","PCI Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","R","R","R","0x00","Processor Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x02","0x00","R","R","R","0x00","Memory Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x00","R","R","R","0x00"," Scalability Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x07","R","R","0x00","Merge Failure - BIOS version is newer than secondary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x08","R","R","0x00","Merge Failure - BIOS version is older than secondary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x09","R","R","0x00","Merge Failure - Primary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x0A","R","R","0x00","Merge Failure - Communication error occurred with secondary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x0B","R","R","0x00","Merge Failure - Timed out waiting for secondary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x10","R","R","0x00","Merge Failure - No path through partition"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x11","Expected Chassis Count","R","0x00","Merge Information - Expected chassis count"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x12","Actual Chassis Count","R","0x00","Merge Information - Actual chassis count"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x19","R","R","0x00","Merge Failure - No secondary servers found to merge"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x34","R","R","0x00","Merge Failure - Primary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x35","R","R","0x00","Merge Failure - Communication error occurred with primary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x36","R","R","0x00","Merge Failure - Secondary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x41","R","R","0x00","Merge Failure - Timeout occurred waiting for primary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x46","R","R","0x00","Merge Failure - BIOS version is newer than primary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x47","R","R","0x00","Merge Failure - BIOS version is older than primary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x52","R","R","0x00","Merge Failure - Scalability hardware not detected"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x53","R","R","0x00","Merge Failure - No partition descriptor found"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x54","R","R","0x00","Merge Failure - Error Reading partition descriptor"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x55","R","R","0x00","Merge Failure - Error Reading system UUID"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x56","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x57","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x58","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x59","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5A","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5B","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5C","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x04","0x00","R","R","R","0x00","Bus PCI Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x05","0x00","R","R","R","0x00","Chipset Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x06","0x01","PostVersion","BMCVersion","R","0x00","Incompatible BIOS-BMC Power Executive support"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x06","0x02","R","R","R","0x00","Boot denied due to power limitations"
|
@ -27,10 +27,6 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
Name: ipmitool
|
||||
Summary: ipmitool - Utility for IPMI control
|
||||
Version: @VERSION@
|
||||
Release: 1%{?_distro:.%{_distro}}
|
||||
Copyright: BSD
|
||||
Release: @RPM_RELEASE@%{?_distro:.%{_distro}}
|
||||
License: BSD
|
||||
Group: Utilities
|
||||
Packager: Duncan Laurie <duncan@iceblink.org>
|
||||
Source: ipmitool-@VERSION@.tar.gz
|
||||
Packager: Jim Mankovich <jmank@hp.com>
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
Buildroot: /var/tmp/ipmitool-root
|
||||
|
||||
%description
|
||||
@ -50,19 +50,218 @@ make DESTDIR=$RPM_BUILD_ROOT install-strip
|
||||
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
rm -rf $RPM_BUILD_DIR/ipmitool-@VERSION@
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/*
|
||||
%{_sbindir}/*
|
||||
%defattr(755,root,root)
|
||||
%attr(755,root,root) %{_bindir}/*
|
||||
%attr(755,root,root) %{_sbindir}/*
|
||||
%{_datadir}/ipmitool/*
|
||||
%doc %{_mandir}/man1/*
|
||||
%doc %{_mandir}/man8/*
|
||||
%doc %{_datadir}/doc/ipmitool/*
|
||||
%{_mandir}/man*/*
|
||||
%doc %{_datadir}/doc/ipmitool
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat Jan 14, 2006 <duncan@iceblink.org> 1.8.5-1
|
||||
* Wed Feb 25 2009 <pere@hungry.com> 1.8.11-1
|
||||
- Fix new GCC compilation issues in regards to Packing
|
||||
- Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
|
||||
for 2.4 kernel instead of ipmi_si_drv driver module
|
||||
- New -y option added to allow specification of kg keys with
|
||||
non-printable characters
|
||||
- New -K option added to allow kgkey settings via environmental
|
||||
variable IPMI_KGKEY
|
||||
- Generic device support added for EEPROM with SDR Type 10h (gendev)
|
||||
- Fix to lan-bridging for a double-bridging crash and to fix
|
||||
an issue with bridging multiple concurrent requests and
|
||||
erroneous handling of raw Send Message
|
||||
- Lanplus fix for commands like 'sensor list' without the -t option
|
||||
causing wrong double bridged requests of a sensor is located
|
||||
on another satellite controller
|
||||
- Fix lan and lanplus request list entry removal bugs
|
||||
- Fix non-working issue when trying to send a bridge message with
|
||||
Cipher 3
|
||||
- Change bridge message handling to reuse command ipmi_lan_poll_recv
|
||||
- Added PICMG 2.0 and 2.3 support
|
||||
- Fix PICMG (ATCA) extension verification and reversal of BCD encoded
|
||||
values for "major" and "minor" fields
|
||||
- Add IANA support for Pigeon Point
|
||||
- Add OEM SW/FW Record identification
|
||||
- Fix to include I2C and LUN addresses so sensors are correctly managed
|
||||
- Patch ID 1990560 to get readings from non-linear analog sensors
|
||||
- Add support for SOL payload status command
|
||||
- SOL set parameter range checking added
|
||||
- Fixed SOL activate options usage
|
||||
- Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
|
||||
- Added retries to SOL keepalive
|
||||
- Fixed wrong mask values for Front Panel disable/enable status
|
||||
- Add support to access fru internal use area
|
||||
- Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
|
||||
blocks of data within the FRU storage area to be write protected.
|
||||
- Fix node reporting in GUID; Tracker bug #2339675
|
||||
- Fix watchdog use/action print strings
|
||||
- Fix endian bug in SDR add from file; Tracker bug #2075258
|
||||
- Fix crash when dumping SDRs in a file and there's an error
|
||||
getting an SDR; improve algorithm for optimal packet size
|
||||
- Fix occasional SDR dump segfault; #1793076
|
||||
- Allow ipmitool sel delete to accept hex list entry numbers
|
||||
- Fix SEL total space reporting.
|
||||
- Fix for garbage sensor threshold values reported when none
|
||||
returned. Tracker Bug #863748
|
||||
- ipmievd change to Monitor %used in SEL buffer and log warnings when
|
||||
the buffer is 80% and 100% full
|
||||
|
||||
* Fri Aug 08 2008 <pere@hungry.com> 1.8.10-1
|
||||
- Added support for BULL IANA number.
|
||||
- Fixed contrib build so the oem_ibm_sel_map file gets included in rpm
|
||||
builds again.
|
||||
- Added support for Debian packages to be built from CVS
|
||||
- Fix for sdr and sel timestamp reporting issues
|
||||
- Fix for discrete sensor state print routines to address state bits 8-14
|
||||
- Change ipmi_chassis_status() to non-static so it can be used externally
|
||||
- Added retries to SOL keepalive
|
||||
- Fix to stop sensor list command from reporting a failure due to missing
|
||||
sensor
|
||||
- Fix bug in sdr free space reporting
|
||||
- Add support for IANA number to vendor name conversion for many vendors
|
||||
- Fix segfault bug in lan set command
|
||||
- Fix bug in population of raw i2c wdata buffer
|
||||
- Fix bug in ipmb sensor reading
|
||||
- Fix misspellings, typos, incorrect strncmp lengths, white space
|
||||
- Update/fix printed help and usages for many commands
|
||||
- Add and update support for all commands in ipmitool man page
|
||||
- Fix for lanplus session re-open when the target becomes unavailable following
|
||||
a fw upgrade activation
|
||||
- Add support for watchdog timer shutoff, reset, and get info
|
||||
- Add support for more ibm systems in oem_ibm_sel_map
|
||||
- Add more JEDEC support info for DIMMs; decrease request size for DIMM FRU
|
||||
info to 16 bytes at a time to allow more DIMM FRUs to respond.
|
||||
- Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg buffer
|
||||
length more aggressively when no response from iol
|
||||
- Fix HPM firmware activation via IOL; fake a timeout after IOL session
|
||||
re-open to force get upgrade status retry; Added retries on 0xD3
|
||||
completion code
|
||||
- Add support for freeipmi 0.6.0; adjust autoconf for changes
|
||||
- Fix for oemval2str size
|
||||
- Add support for product name resolution in mc info
|
||||
- Fix FRU display format
|
||||
- Added PICMG ekeying analyzer module support (ekanalyzer); display point
|
||||
to point physical connectivity and power supply information between
|
||||
carriers and AMC modules; display matched results of ekeying match
|
||||
between an on-carrier device and AMC module or between 2 AMC modules
|
||||
- Fix AMC GUID display support
|
||||
- Improved amcportstate operations
|
||||
- Added resolution for new sensor types
|
||||
- Fix segfault in SOL
|
||||
- Fix bug that caused infinite loop on BMCs with empty SDRs
|
||||
- Fix to move out Kontron OEM sensor resolution for other OEMs which could
|
||||
lead to bad event descriptions
|
||||
- Add new FRU edit mode thereby allowing serial numbers, etc. to be changed;
|
||||
improvements to OEM edit mode
|
||||
- Added SPD support for parms: channel number, max read size
|
||||
- Add SDR support for adding SDR records from a dumped file, clearing SDR,
|
||||
adding partial SDR records
|
||||
- Add updates and fixes to hpmfwupg: upload block size to 32 bytes for KCS,
|
||||
handle long response option, implement rollback override, garbage output fix
|
||||
- Add double bridge lan support , fix bridging issue
|
||||
- Add HPM support to pre-check which components need to be skipped
|
||||
- Fix autodetection of maximum packet size when using IPMB
|
||||
- Add new Kontron OEM command to set the BIOS boot option sequence
|
||||
- Add support for dual-bridge/ dual send message
|
||||
- Add auto-detect for local IPMB address using PICMG 2.X extension
|
||||
- Add support for HPM.1 1.0 specification compliance
|
||||
- Fix for improper lan/lanplus addressing
|
||||
- Added transit_channel and transit_addr to ipmi_intf struct
|
||||
- Fix bad password assertion bug due to rakp2 HMAC not being checked properly
|
||||
- Added ability to interpret PPS shelf manager clia sel dump
|
||||
- Corrected PICMG M7 state event definition macros
|
||||
- Added FRU parsing enhancements
|
||||
- Added "isol info", "isol set" and "isol activate" commands to support
|
||||
Intel IPMI v1.5 SOL functionality. Removed "isol setup" command.
|
||||
- Fix bug in ipmi_lan_recv_packet() in lan and lanplus interfaces.
|
||||
- Fix bug in "chassis poh" command.
|
||||
- Fix HPM.1 upgrade to apply to only given component when instructed to do so
|
||||
- Added configure auto-detection if dual bridge extension is supported
|
||||
by OpenIPMI
|
||||
|
||||
* Tue Mar 6 2007 <pere@hungry.com> 1.8.9-1
|
||||
- Added initial AMC ekey query operation support
|
||||
- Improvements to ekeying support (PICMG 3.x only)
|
||||
- Added initial interactive edition support for multirec; added IANA
|
||||
verification before interpreting PICMG records.
|
||||
- Added edit support for AMC activation "Maximum Internal Current"
|
||||
- Fix bug generating garbage on the screen when handling GetDeviceId
|
||||
and sol traffic occurs
|
||||
- Added ability to map OEM sensor types to OEM description string using
|
||||
IANA number; moved IANA number table
|
||||
- Fix lan set access command to use value already saved within parameters
|
||||
for PEF and authentication
|
||||
- Fix bug in cmd ipmitool lan stats get 1
|
||||
- Add support to allow ipmitool/ipmievd to target specific device nodes
|
||||
on multi-BMC systems
|
||||
- Add support for name+privilege lookup for lanplus sessions
|
||||
- Fix time_t conversion bug for 64-bit OS
|
||||
- Added prefix of hostname on sel ipmievd sessions
|
||||
- Fixed FWUM Get Info
|
||||
- Fix ipmievd fd closing bug
|
||||
- Add set-in-progress flag support to chassis bootdev
|
||||
- Added new chassis bootdev options
|
||||
- Add sol payload enable/disable comman
|
||||
- Fix SOL set errors when commit-write not supported
|
||||
- Fix reset of session timeout for lanplus interface
|
||||
- Fixed lan interface accessibility timeout handling
|
||||
- Fix bug with Function Get Channel Cipher Suites command when more
|
||||
than 1 page used.
|
||||
- Fix missing firmware firewall top-level command
|
||||
- Fix bug in SOL keepalive functionality
|
||||
- Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
|
||||
- Added ipmi_sel_get_oem_sensor* APIs
|
||||
- Added HPM.1 support
|
||||
- Fix segfault when incorrect oem option supplied
|
||||
- Fix bus problem with spd command
|
||||
- Fix segfault in SOL when remote BMC does not return packet
|
||||
- Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
|
||||
- Added lan packet size reduction mechanism
|
||||
- Fix bug with sendMessage of bad length with different target
|
||||
- Fix for big endian (PPC) architecture
|
||||
- NetBSD fixes
|
||||
- Fix segfault and channel problem with user priv command
|
||||
- Add support for bus/chan on i2c raw command
|
||||
- Add freeipmi interface support
|
||||
- Add remote spd printing
|
||||
- Add better detection of linux/compiler.h to config
|
||||
- Makefile changes to fix makedistcheck, etc.
|
||||
|
||||
* Tue May 02 2006 <duncan@iceblink.org> 1.8.8-1
|
||||
- Fix segfaults in sensor data repository list
|
||||
- Fix ipmievd to open interface before daemonizing
|
||||
- Fix IPMIv1.5 authtype NONE to ignore supplied password
|
||||
- Fix cipher suite display bug in lan print
|
||||
- Fix typo in IPMIv2 SOL output when sending break
|
||||
- Fix improper LUN handling with Tyan SOL
|
||||
- Add LUN support to OpenIPMI interface
|
||||
- Add support for Kontron OEM commands
|
||||
- Update to Kontron Firmware Update command
|
||||
|
||||
* Sun Mar 19 2006 <duncan@iceblink.org> 1.8.7-1
|
||||
- Add Sun OEM command for blades
|
||||
- Increase argument size for raw commands in shell/exec
|
||||
- Fix handling of LUNs for LAN interfaces
|
||||
- Add IPMIv2 SOL loopback test
|
||||
- Add support for IBM OEM SEL messages
|
||||
- Disable file paranoia checks on read files by default
|
||||
- Support IPMIv2 SOL on older Intel boxes
|
||||
- Display message and exit if keepalive fails during SOL
|
||||
- Add support for setting VLAN id and priority
|
||||
- Add support for FreeBSD OpenIPMI-compatible driver
|
||||
- Add support for IPMIv2 Firmware Firewall
|
||||
- Fix gcc4 compile warnings
|
||||
- Make ipmievd generate pidfile
|
||||
- Add initscripts for ipmievd
|
||||
|
||||
* Mon Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
|
||||
- Fix memory corruption when sending encrypted SOL traffic
|
||||
- Add keepalive timer to IPMIv2 SOL sessions
|
||||
|
||||
* Sat Jan 14 2006 <duncan@iceblink.org> 1.8.5-1
|
||||
- Raise privilege level after creating IPMIv2 session
|
||||
- Add support for settable SOL escape character with -e option
|
||||
- Add support for Kg BMC key for IPMIv2 authentication with -k option
|
||||
|
@ -8,5 +8,5 @@
|
||||
%_srcrpmdir %{_topdir}/SRPMS
|
||||
%_distro @DISTRO@
|
||||
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
|
||||
%packager duncan@iceblink.org
|
||||
%packager jmank@hp.com
|
||||
%distribution Sourceforge Build
|
||||
|
@ -1,3 +1,111 @@
|
||||
version (1.8.11) unstable; urgency=low
|
||||
* Fix new GCC compilation issues in regards to Packing
|
||||
* Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
|
||||
for 2.4 kernel instead of ipmi_si_drv driver module
|
||||
* New -y option added to allow specification of kg keys with
|
||||
non-printable characters
|
||||
* New -K option added to allow kgkey settings via environmental
|
||||
variable IPMI_KGKEY
|
||||
* Generic device support added for EEPROM with SDR Type 10h (gendev)
|
||||
* Fix to lan-bridging for a double-bridging crash and to fix
|
||||
an issue with bridging multiple concurrent requests and
|
||||
erroneous handling of raw Send Message
|
||||
* Lanplus fix for commands like 'sensor list' without the -t option
|
||||
causing wrong double bridged requests of a sensor is located
|
||||
on another satellite controller
|
||||
* Fix lan and lanplus request list entry removal bugs
|
||||
* Fix non-working issue when trying to send a bridge message with
|
||||
Cipher 3
|
||||
* Change bridge message handling to reuse command ipmi_lan_poll_recv
|
||||
* Added PICMG 2.0 and 2.3 support
|
||||
* Fix PICMG (ATCA) extension verification and reversal of BCD encoded
|
||||
values for "major" and "minor" fields
|
||||
* Add IANA support for Pigeon Point
|
||||
* Add OEM SW/FW Record identification
|
||||
* Fix to include I2C and LUN addresses so sensors are correctly managed
|
||||
* Patch ID 1990560 to get readings from non-linear analog sensors
|
||||
* Add support for SOL payload status command
|
||||
* SOL set parameter range checking added
|
||||
* Fixed SOL activate options usage
|
||||
* Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
|
||||
* Added retries to SOL keepalive
|
||||
* Fixed wrong mask values for Front Panel disable/enable status
|
||||
* Add support to access fru internal use area
|
||||
* Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
|
||||
blocks of data within the FRU storage area to be write
|
||||
protected.
|
||||
* Fix node reporting in GUID; Tracker bug #2339675
|
||||
* Fix watchdog use/action print strings
|
||||
* Fix endian bug in SDR add from file; Tracker bug #2075258
|
||||
* Fix crash when dumping SDRs in a file and there's an error
|
||||
getting an SDR; improve algorithm for optimal packet size
|
||||
* Fix occasional SDR dump segfault; #1793076
|
||||
* Allow ipmitool sel delete to accept hex list entry numbers
|
||||
* Fix SEL total space reporting.
|
||||
* Fix for garbage sensor threshold values reported when none
|
||||
returned. Tracker Bug #863748
|
||||
* ipmievd change to Monitor %used in SEL buffer and log warnings when
|
||||
the buffer is 80% and 100% full
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Wed, 25 Feb 2009 09:44:31 +0200
|
||||
|
||||
ipmitool (1.8.10) unstable; urgency=low
|
||||
|
||||
* New upstream version.
|
||||
* Patch to allow Debian package builds from cvs.
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Fri, 8 Aug 2008 09:44:31 +0200
|
||||
|
||||
ipmitool (1.8.7-2) unstable; urgency=low
|
||||
|
||||
* Fix typo in init.d/ipmievd. (Closes: #361309)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sat, 8 Apr 2006 06:44:31 +0200
|
||||
|
||||
ipmitool (1.8.7-1) unstable; urgency=low
|
||||
|
||||
* New upstream version.
|
||||
- Dropped nuclear clause from the copyright. Updated debian/copyright
|
||||
to reflect this.
|
||||
- ipmievd now store pid in /var/run/ipmievd.pid. Adjust init.d
|
||||
script to use it.
|
||||
* Rename /etc/default/ipmievd variable IPMIEVD_OPTS is renamed to
|
||||
IPMIEVD_OPTIONS to stay compatible with upstream and other
|
||||
distributions. Add backwards compatibility code with a warning to
|
||||
the users of the old variable.
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sun, 26 Mar 2006 21:11:08 +0200
|
||||
|
||||
ipmitool (1.8.6-2) unstable; urgency=low
|
||||
|
||||
* Add ia64 as an supported arch. (Closes: #355930)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Fri, 10 Mar 2006 23:34:50 +0100
|
||||
|
||||
ipmitool (1.8.6-1) unstable; urgency=low
|
||||
|
||||
* New upstream version.
|
||||
- Avoid crashing when setting lan IP address. (Closes: #351205)
|
||||
* Avoid changing history by reverding upstream change
|
||||
to email addresses in debian/changelog.
|
||||
* Correct typo in control file: Suggest -> Suggests. Thanks
|
||||
to Philipp Matthias Hahn for the report.
|
||||
* Add init.d/ipmievd script. Based on script from Elmar Hoffmann,
|
||||
slightly modified to use lsb-base functions. Added dependency on
|
||||
lsb-base. (Closes: #345994)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sun, 26 Feb 2006 10:31:14 +0100
|
||||
|
||||
ipmitool (1.8.2-2) unstable; urgency=low
|
||||
|
||||
* Add build-dependency on 'libreadline5-dev | libreadline-dev' to make
|
||||
sure all archs get readline support. (Closes: #326341)
|
||||
* Add build-dependency on libssl-dev to enable SSL support on
|
||||
all archs.
|
||||
* Updated Standards-Version to 3.6.2.1. (No updates required)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sat, 3 Sep 2005 19:18:51 +0200
|
||||
|
||||
ipmitool (1.8.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
@ -3,13 +3,13 @@ Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Petter Reinholdtsen <pere@debian.org>
|
||||
Uploaders: Duncan Laurie <duncan@iceblink.org>
|
||||
Build-Depends: debhelper (>> 4.0.0),
|
||||
Standards-Version: 3.6.1
|
||||
Build-Depends: debhelper (>> 4.0.0), libreadline5-dev | libreadline-dev, libssl-dev, autoconf, automake1.9 | automake, autotools-dev, libtool
|
||||
Standards-Version: 3.6.2.1
|
||||
|
||||
Package: ipmitool
|
||||
Architecture: i386 amd64
|
||||
Depends: ${shlibs:Depends}
|
||||
Suggest: openipmi
|
||||
Architecture: i386 amd64 ia64
|
||||
Depends: ${shlibs:Depends}, lsb-base
|
||||
Suggests: openipmi
|
||||
Description: utility for IPMI control with kernel driver or LAN interface
|
||||
A utility for managing and configuring devices that support the
|
||||
Intelligent Platform Management Interface. IPMI is an open standard
|
||||
|
@ -34,7 +34,3 @@ OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
You acknowledge that this software is not designed or intended for use
|
||||
in the design, construction, operation or maintenance of any nuclear
|
||||
facility.
|
||||
|
99
ipmitool/debian/ipmitool.ipmievd.init
Normal file
99
ipmitool/debian/ipmitool.ipmievd.init
Normal file
@ -0,0 +1,99 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $local_fs $remote_fs $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: S 0 1 6
|
||||
# Short-Description: IPMI event daemon
|
||||
# Description: ipmievd is a daemon which will listen for events
|
||||
# from the BMC that are being sent to the SEL and
|
||||
# also log those messages to syslog.
|
||||
### END INIT INFO
|
||||
#
|
||||
# Author: Elmar Hoffmann <elho@elho.net>
|
||||
# Licence: This script is public domain using the same
|
||||
# licence as ipmitool itself.
|
||||
# Modified by: Petter Reinholdtsen
|
||||
|
||||
set -e
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="IPMI event daemon"
|
||||
NAME=ipmievd
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /etc/default/rcS
|
||||
|
||||
# Options used by ipmievd.
|
||||
#
|
||||
# "open" uses the asynchronous event notification from the OpenIPMI
|
||||
# kernel driver, "sel" uses active polling of the contents of the SEL
|
||||
# for new events.
|
||||
#
|
||||
# Need to force 'daemon' mode, to make sure messages are sent to
|
||||
# syslog and the program forks into the background.
|
||||
#
|
||||
# Se ipmievd(8) for more info.
|
||||
IPMIEVD_OPTIONS="open daemon"
|
||||
|
||||
# Read config file if it is present.
|
||||
[ -f /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Backwards compatibility with version 1.8.6-2 and 1.8.6-1. The
|
||||
# variable was renamed to be compatible with upstream, SuSe and RedHat.
|
||||
if [ -n "$IPMIEVD_OPTS" ]; then
|
||||
echo "warning: /etc/default/$NAME variable IPMIEVD_OPTS should be renamed to IPMIEVD_OPTIONS"
|
||||
IPMIEVD_OPTIONS="$IPMIEVD_OPTS"
|
||||
fi
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service.
|
||||
#
|
||||
d_start() {
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- $IPMIEVD_OPTIONS
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service.
|
||||
#
|
||||
d_stop() {
|
||||
start-stop-daemon --stop --quiet --name $NAME --exec $DAEMON
|
||||
}
|
||||
|
||||
CODE=0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
|
||||
d_start || CODE=$?
|
||||
[ "$VERBOSE" != no ] && log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
stop)
|
||||
log_begin_msg "Stopping $DESC" "$NAME"
|
||||
d_stop || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_begin_msg "Restarting $DESC" "$NAME"
|
||||
d_stop || true
|
||||
sleep 1
|
||||
d_start || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -18,6 +18,9 @@ endif
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
|
||||
./bootstrap
|
||||
|
||||
./configure --prefix=/usr \
|
||||
--with-kerneldir \
|
||||
--mandir=/usr/share/man
|
||||
@ -91,6 +94,7 @@ binary-common:
|
||||
dh_testroot
|
||||
dh_installdocs
|
||||
dh_installchangelogs
|
||||
dh_installinit --name ipmievd
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
|
@ -27,10 +27,6 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
.SH "NAME"
|
||||
ipmievd \- IPMI event daemon for sending events to syslog
|
||||
.SH "SYNOPSIS"
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-d \fIN\fP\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
\fB\-I\fR \fIopen\fP <\fIopen\fR | \fIsel\fR> [<\fIoption\fP>]
|
||||
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
@ -13,6 +13,7 @@ ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
[\fB\-L\fR <\fIprivlvl\fP>]
|
||||
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
|
||||
[\fB\-o\fR <\fIoemtype\fP>]
|
||||
[\fB\-O\fR <\fIsel oem\fP>]
|
||||
\fIsel\fP [<\fIoption\fP>]
|
||||
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
@ -22,6 +23,7 @@ ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
[\fB\-L\fR <\fIprivlvl\fP>]
|
||||
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
|
||||
[\fB\-o\fR <\fIoemtype\fP>]
|
||||
[\fB\-O\fR <\fIsel oem\fP>]
|
||||
[\fB\-C\fR <\fIciphersuite\fP>]
|
||||
\fIsel\fR [<\fIoption\fP>]
|
||||
.SH "DESCRIPTION"
|
||||
@ -44,7 +46,7 @@ Prompt for the remote server password.
|
||||
.TP
|
||||
\fB\-A\fR <\fIauthtype\fP>
|
||||
Specify an authentication type to use during IPMIv1.5 \fIlan\fP
|
||||
session activation. Supported types are NONE, PASSWORD, MD5, or OEM.
|
||||
session activation. Supported types are NONE, PASSWORD, MD2, MD5, or OEM.
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
Present output in CSV (comma separated variable) format.
|
||||
@ -90,6 +92,10 @@ in place in the code to work around quirks in various BMCs from
|
||||
various manufacturers. Use \fI\-o list\fP to see a list of
|
||||
current supported OEM types.
|
||||
.TP
|
||||
\fB\-O\fR <\fIsel oem\fP>
|
||||
Open selected file and read OEM SEL event descriptions to be used
|
||||
during SEL listings. See examples in contrib dir for file format.
|
||||
.TP
|
||||
\fB\-p\fR <\fIport\fP>
|
||||
Remote server UDP port to connect to. Default is 623.
|
||||
.TP
|
||||
@ -110,6 +116,13 @@ Bridge IPMI requests to the remote target address.
|
||||
\fB\-U\fR <\fIusername\fP>
|
||||
Remote server username, default is NULL user.
|
||||
.TP
|
||||
\fB\-d \fIN\fP\fR
|
||||
Use device number N to specify the /dev/ipmiN (or
|
||||
/dev/ipmi/N or /dev/ipmidev/N) device to use for in-band
|
||||
BMC communication. Used to target a specific BMC on a
|
||||
multi-node, multi-BMC system through the ipmi device
|
||||
driver interface. Default is 0.
|
||||
.TP
|
||||
\fB\-v\fR
|
||||
Increase verbose output level. This option may be specified
|
||||
multiple times to increase the level of debug output. If given
|
||||
@ -158,6 +171,11 @@ All messages will be sent to syslog. This is the default action.
|
||||
.TP
|
||||
\fInodaemon\fP
|
||||
Do NOT become a daemon, instead log all messages to stderr.
|
||||
.TP
|
||||
\fIpidfile\fP=<\fBfilename\fR>
|
||||
Save process ID to this file when in daemon mode. Defaults to
|
||||
/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.RE
|
||||
|
||||
.TP
|
||||
@ -176,6 +194,11 @@ All messages will be sent to syslog. This is the default action.
|
||||
.TP
|
||||
\fInodaemon\fP
|
||||
Do NOT become a daemon, instead log all messages to stderr.
|
||||
.TP
|
||||
\fIpidfile\fP=<\fBfilename\fR>
|
||||
Save process ID to this file when in daemon mode. Defaults to
|
||||
/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.TP
|
||||
\fItimeout\fP=<\fBseconds\fR>
|
||||
Time between checks for SEL polling method. Default is 10 seconds.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -27,10 +27,6 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
|
@ -27,18 +27,16 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_intf.h \
|
||||
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_lanp.h \
|
||||
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
|
||||
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_hpmfwupg.h ipmi_lanp.h \
|
||||
ipmi_sdr.h ipmi_sel.h ipmi_sol.h ipmi_mc.h ipmi_raw.h \
|
||||
ipmi_channel.h ipmi_sensor.h ipmi_event.h ipmi_session.h \
|
||||
ipmi_strings.h ipmi_constants.h ipmi_user.h ipmi_pef.h \
|
||||
ipmi_oem.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
|
||||
ipmi_fwum.h ipmi_main.h ipmi_tsol.h
|
||||
ipmi_oem.h ipmi_sdradd.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
|
||||
ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
|
||||
ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \
|
||||
ipmi_delloem.h ipmi_dcmi.h
|
||||
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_BSWAP_H
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_HELPER_H
|
||||
@ -42,11 +38,55 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef tboolean
|
||||
#define tboolean int
|
||||
#endif
|
||||
|
||||
/* IPMI spec. - UID 0 reserved, 63 maximum UID which can be used */
|
||||
#ifndef IPMI_UID_MIN
|
||||
# define IPMI_UID_MIN 1
|
||||
#endif
|
||||
#ifndef IPMI_UID_MAX
|
||||
# define IPMI_UID_MAX 63
|
||||
#endif
|
||||
|
||||
struct ipmi_intf;
|
||||
|
||||
struct valstr {
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
};
|
||||
struct oemvalstr {
|
||||
uint32_t oem;
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
};
|
||||
|
||||
const char * val2str(uint16_t val, const struct valstr * vs);
|
||||
const char * oemval2str(uint32_t oem,uint16_t val, const struct oemvalstr * vs);
|
||||
|
||||
int str2double(const char * str, double * double_ptr);
|
||||
int str2long(const char * str, int64_t * lng_ptr);
|
||||
int str2ulong(const char * str, uint64_t * ulng_ptr);
|
||||
int str2int(const char * str, int32_t * int_ptr);
|
||||
int str2uint(const char * str, uint32_t * uint_ptr);
|
||||
int str2short(const char * str, int16_t * shrt_ptr);
|
||||
int str2ushort(const char * str, uint16_t * ushrt_ptr);
|
||||
int str2char(const char * str, int8_t * chr_ptr);
|
||||
int str2uchar(const char * str, uint8_t * uchr_ptr);
|
||||
|
||||
int is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr);
|
||||
int is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr);
|
||||
int is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr);
|
||||
|
||||
uint16_t str2val(const char * str, const struct valstr * vs);
|
||||
void print_valstr(const struct valstr * vs, const char * title, int loglevel);
|
||||
void print_valstr_2col(const struct valstr * vs, const char * title, int loglevel);
|
||||
@ -58,7 +98,7 @@ const char * buf2str(uint8_t * buf, int len);
|
||||
void printbuf(const uint8_t * buf, int len, const char * desc);
|
||||
uint8_t ipmi_csum(uint8_t * d, int s);
|
||||
FILE * ipmi_open_file(const char * file, int rw);
|
||||
void ipmi_start_daemon(void);
|
||||
void ipmi_start_daemon(struct ipmi_intf *intf);
|
||||
|
||||
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
|
||||
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_H
|
||||
@ -43,9 +39,21 @@
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_cc.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define IPMI_BUF_SIZE 1024
|
||||
|
||||
#if HAVE_PRAGMA_PACK
|
||||
#define ATTRIBUTE_PACKING
|
||||
#else
|
||||
#define ATTRIBUTE_PACKING __attribute__ ((packed))
|
||||
#endif
|
||||
|
||||
|
||||
/* From table 13.16 of the IPMI v2 specification */
|
||||
#define IPMI_PAYLOAD_TYPE_IPMI 0x00
|
||||
#define IPMI_PAYLOAD_TYPE_SOL 0x01
|
||||
@ -140,6 +148,7 @@ struct ipmi_rq_entry {
|
||||
uint8_t rq_seq;
|
||||
uint8_t *msg_data;
|
||||
int msg_len;
|
||||
int bridging_level;
|
||||
struct ipmi_rq_entry *next;
|
||||
};
|
||||
|
||||
@ -230,14 +239,51 @@ struct ipmi_rs {
|
||||
#define IPMI_NETFN_APP 0x6
|
||||
#define IPMI_NETFN_FIRMWARE 0x8
|
||||
#define IPMI_NETFN_STORAGE 0xa
|
||||
#define IPMI_NETFN_TRANSPORT 0xc
|
||||
#define IPMI_NETFN_TRANSPORT 0xc
|
||||
#define IPMI_NETFN_PICMG 0x2C
|
||||
#define IPMI_NETFN_DCGRP 0x2C
|
||||
#define IPMI_NETFN_OEM 0x2E
|
||||
#define IPMI_NETFN_ISOL 0x34
|
||||
#define IPMI_NETFN_TSOL 0x30
|
||||
|
||||
#define IPMI_BMC_SLAVE_ADDR 0x20
|
||||
#define IPMI_REMOTE_SWID 0x81
|
||||
|
||||
|
||||
/* These values are IANA numbers */
|
||||
typedef enum IPMI_OEM {
|
||||
IPMI_OEM_UNKNOWN = 0,
|
||||
IPMI_OEM_HP = 11,
|
||||
IPMI_OEM_SUN = 42,
|
||||
IPMI_OEM_NOKIA = 94,
|
||||
IPMI_OEM_BULL = 107,
|
||||
IPMI_OEM_HITACHI_116 = 116,
|
||||
IPMI_OEM_NEC = 119,
|
||||
IPMI_OEM_TOSHIBA = 186,
|
||||
IPMI_OEM_INTEL = 343,
|
||||
IPMI_OEM_TATUNG = 373,
|
||||
IPMI_OEM_HITACHI_399 = 399,
|
||||
IPMI_OEM_DELL = 674,
|
||||
IPMI_OEM_LMC = 2168,
|
||||
IPMI_OEM_RADISYS = 4337,
|
||||
IPMI_OEM_BROADCOM = 4413,
|
||||
IPMI_OEM_MAGNUM = 5593,
|
||||
IPMI_OEM_TYAN = 6653,
|
||||
IPMI_OEM_NEWISYS = 9237,
|
||||
IPMI_OEM_FUJITSU_SIEMENS = 10368,
|
||||
IPMI_OEM_AVOCENT = 10418,
|
||||
IPMI_OEM_PEPPERCON = 10437,
|
||||
IPMI_OEM_SUPERMICRO = 10876,
|
||||
IPMI_OEM_OSA = 11102,
|
||||
IPMI_OEM_GOOGLE = 11129,
|
||||
IPMI_OEM_PICMG = 12634,
|
||||
IPMI_OEM_RARITAN = 13742,
|
||||
IPMI_OEM_KONTRON = 15000,
|
||||
IPMI_OEM_PPS = 16394,
|
||||
IPMI_OEM_AMI = 20974,
|
||||
IPMI_OEM_NOKIA_SIEMENS_NETWORKS = 28458
|
||||
} IPMI_OEM;
|
||||
|
||||
extern const struct valstr completion_code_vals[];
|
||||
|
||||
#endif /* IPMI_H */
|
||||
|
76
ipmitool/include/ipmitool/ipmi_cc.h
Normal file
76
ipmitool/include/ipmitool/ipmi_cc.h
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CC_H
|
||||
#define IPMI_CC_H
|
||||
|
||||
/*
|
||||
Thu Jan 11 09:32:41 2007
|
||||
francois.isabelle@ca.kontron.com
|
||||
|
||||
I just noticed that most modules refer to IPMI completion codes using
|
||||
hard coded values ...
|
||||
*/
|
||||
|
||||
/*
|
||||
* CC
|
||||
* See IPMI specification table 5-2 Generic Completion Codes
|
||||
*/
|
||||
|
||||
#define IPMI_CC_OK 0x00
|
||||
#define IPMI_CC_NODE_BUSY 0xc0
|
||||
#define IPMI_CC_INV_CMD 0xc1
|
||||
#define IPMI_CC_INV_CMD_FOR_LUN 0xc2
|
||||
#define IPMI_CC_TIMEOUT 0xc3
|
||||
#define IPMI_CC_OUT_OF_SPACE 0xc4
|
||||
#define IPMI_CC_RES_CANCELED 0xc5
|
||||
#define IPMI_CC_REQ_DATA_TRUNC 0xc6
|
||||
#define IPMI_CC_REQ_DATA_INV_LENGTH 0xc7
|
||||
#define IPMI_CC_REQ_DATA_FIELD_EXCEED 0xc8
|
||||
#define IPMI_CC_PARAM_OUT_OF_RANGE 0xc9
|
||||
#define IPMI_CC_CANT_RET_NUM_REQ_BYTES 0xca
|
||||
#define IPMI_CC_REQ_DATA_NOT_PRESENT 0xcb
|
||||
#define IPMI_CC_INV_DATA_FIELD_IN_REQ 0xcc
|
||||
#define IPMI_CC_ILL_SENSOR_OR_RECORD 0xcd
|
||||
#define IPMI_CC_RESP_COULD_NOT_BE_PRV 0xce
|
||||
#define IPMI_CC_CANT_RESP_DUPLI_REQ 0xcf
|
||||
#define IPMI_CC_CANT_RESP_SDRR_UPDATE 0xd0
|
||||
#define IPMI_CC_CANT_RESP_FIRM_UPDATE 0xd1
|
||||
#define IPMI_CC_CANT_RESP_BMC_INIT 0xd2
|
||||
#define IPMI_CC_DESTINATION_UNAVAILABLE 0xd3
|
||||
#define IPMI_CC_INSUFFICIENT_PRIVILEGES 0xd4
|
||||
#define IPMI_CC_NOT_SUPPORTED_PRESENT_STATE 0xd5
|
||||
#define IPMI_CC_ILLEGAL_COMMAND_DISABLED 0xd6
|
||||
#define IPMI_CC_UNSPECIFIED_ERROR 0xff
|
||||
|
||||
|
||||
#endif /*IPMI_CC_H*/
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CHANNEL_H
|
||||
@ -58,6 +54,9 @@
|
||||
* The Get Authentication Capabilities response structure
|
||||
* From table 22-15 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_channel_auth_cap_rsp {
|
||||
uint8_t channel_number;
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -88,16 +87,19 @@ struct get_channel_auth_cap_rsp {
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved3 : 6;
|
||||
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
#else
|
||||
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
uint8_t __reserved3 : 6;
|
||||
#endif
|
||||
uint8_t oem_id[3]; /* IANA enterprise number for auth type */
|
||||
uint8_t oem_aux_data; /* Additional OEM specific data for oem auths */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -105,6 +107,9 @@ struct get_channel_auth_cap_rsp {
|
||||
* The Get Channel Info response structure
|
||||
* From table 22-29 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_channel_info_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 4;
|
||||
@ -136,7 +141,10 @@ struct get_channel_info_rsp {
|
||||
#endif
|
||||
uint8_t vendor_id[3]; /* For OEM that specified the protocol */
|
||||
uint8_t aux_info[2]; /* Not used*/
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -144,6 +152,9 @@ struct get_channel_info_rsp {
|
||||
* The Get Channel Access response structure
|
||||
* From table 22-28 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_channel_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 2;
|
||||
@ -165,9 +176,14 @@ struct get_channel_access_rsp {
|
||||
uint8_t channel_priv_limit : 4; /* Channel privilege level limit */
|
||||
uint8_t __reserved2 : 4;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_user_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 2;
|
||||
@ -194,8 +210,14 @@ struct get_user_access_rsp {
|
||||
uint8_t callin_callback : 1;
|
||||
uint8_t __reserved4 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct set_user_access_data {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t change_bits : 1;
|
||||
@ -222,7 +244,10 @@ struct set_user_access_data {
|
||||
uint8_t session_limit : 4;
|
||||
uint8_t __reserved3 : 4;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
uint8_t ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel);
|
||||
uint8_t ipmi_current_channel_medium(struct ipmi_intf * intf);
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CHASSIS_H
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CONSTANTS_H
|
||||
@ -42,9 +38,9 @@
|
||||
* COMMANDS
|
||||
*/
|
||||
#define IPMI_GET_SDR_REPOSITORY_INFO 0x20
|
||||
#define IMPI_SOL_ACTIVATING 0x20
|
||||
#define IMPI_SET_SOL_CONFIG_PARAMETERS 0x21
|
||||
#define IMPI_GET_SOL_CONFIG_PARAMETERS 0x22
|
||||
#define IPMI_SOL_ACTIVATING 0x20
|
||||
#define IPMI_SET_SOL_CONFIG_PARAMETERS 0x21
|
||||
#define IPMI_GET_SOL_CONFIG_PARAMETERS 0x22
|
||||
#define IPMI_SET_USER_ACCESS 0x43
|
||||
#define IPMI_GET_USER_ACCESS 0x44
|
||||
#define IPMI_SET_USER_NAME 0x45
|
||||
@ -55,6 +51,8 @@
|
||||
#define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTYION 0x55
|
||||
#define IPMI_GET_SEL_TIME 0x48
|
||||
#define IPMI_SET_SEL_TIME 0x49
|
||||
#define IPMI_SET_USER_PAYLOAD_ACCESS 0x4c
|
||||
#define IPMI_GET_USER_PAYLOAD_ACCESS 0x4d
|
||||
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_NONE 0x01
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_MD2 0x02
|
||||
@ -107,6 +105,15 @@
|
||||
#define IPMI_CHASSIS_POLICY_PREVIOUS 0x1
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0
|
||||
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS 0
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SVCPART_SELECT 1
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SVCPART_SCAN 2
|
||||
#define IPMI_CHASSIS_BOOTPARAM_FLAG_VALID 3
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INFO_ACK 4
|
||||
#define IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS 5
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INIT_INFO 6
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INIT_MBOX 7
|
||||
|
||||
/* From table 13-17 of the IPMI v2 specification */
|
||||
#define IPMI_AUTH_RAKP_NONE 0x00
|
||||
#define IPMI_AUTH_RAKP_HMAC_SHA1 0x01
|
||||
|
129
ipmitool/include/ipmitool/ipmi_dcmi.h
Normal file
129
ipmitool/include/ipmitool/ipmi_dcmi.h
Normal file
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* All rights reserved
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef IPMI_DCMI_H
|
||||
#define IPMI_DCMI_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* DCMI commands per DCMI 1.5 SPEC */
|
||||
|
||||
#define IPMI_DCMI 0xDC /* Group Extension Identification */
|
||||
#define IPMI_DCMI_COMPAT 0x01
|
||||
#define IPMI_DCMI_GETRED 0x02
|
||||
#define IPMI_DCMI_GETLMT 0x03
|
||||
#define IPMI_DCMI_SETLMT 0x04
|
||||
#define IPMI_DCMI_PWRACT 0x05
|
||||
#define IPMI_DCMI_GETASSET 0x06
|
||||
#define IPMI_DCMI_SETASSET 0x08
|
||||
#define IPMI_DCMI_GETMNGCTRLIDS 0x09
|
||||
#define IPMI_DCMI_SETMNGCTRLIDS 0x0A
|
||||
#define IPMI_DCMI_SETTERMALLIMIT 0x0B
|
||||
#define IPMI_DCMI_GETTERMALLIMIT 0x0C
|
||||
#define IPMI_DCMI_GETSNSR 0x07
|
||||
#define IPMI_DCMI_PWRMGT 0x08
|
||||
#define IPMI_DCMI_GETTEMPRED 0x10
|
||||
#define IPMI_DCMI_SETCONFPARAM 0x12
|
||||
#define IPMI_DCMI_GETCONFPARAM 0x13
|
||||
|
||||
#define IPMI_DCMI_CONFORM 0x0001
|
||||
#define IPMI_DCMI_1_1_CONFORM 0x0101
|
||||
#define IPMI_DCMI_1_5_CONFORM 0x0501
|
||||
|
||||
#define DCMI_MAX_BYTE_SIZE 0x10
|
||||
#define DCMI_MAX_BYTE_TEMP_READ_SIZE 0x08
|
||||
|
||||
#define GOOD_PWR_GLIMIT_CCODE(ccode) ((ccode = ((ccode == 0x80) ? 0 : ccode)))
|
||||
#define GOOD_ASSET_TAG_CCODE(ccode) ((ccode = (((ccode == 0x80) || (ccode == 0x81) || (ccode == 0x82) || (ccode == 0x83)) ? 0 : ccode)))
|
||||
|
||||
|
||||
struct dcmi_cmd {
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
/* make a struct for the return from the get limit command */
|
||||
struct power_limit {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t reserved_1; /* second and third bytes are reserved */
|
||||
uint8_t action; /* fourth byte is the exception action */
|
||||
uint16_t limit; /* fifth through sixth byte are the power limit in watts */
|
||||
uint32_t correction; /* seventh - 10th bytes are the correction period */
|
||||
uint16_t reserved_2; /* 11th - 12th are reserved bytes */
|
||||
uint16_t sample; /* 13th - 14th are sample period time */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the reading command */
|
||||
struct power_reading {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t curr_pwr;
|
||||
uint16_t min_sample;
|
||||
uint16_t max_sample;
|
||||
uint16_t avg_pwr;
|
||||
uint32_t time_stamp; /* time since epoch */
|
||||
uint32_t sample;
|
||||
uint8_t state;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the capabilites command */
|
||||
struct capabilities {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t conformance;
|
||||
uint8_t revision;
|
||||
uint8_t data_byte1;
|
||||
uint8_t data_byte2;
|
||||
uint8_t data_byte3;
|
||||
uint8_t data_byte4;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the sensor info command */
|
||||
struct sensor_info {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t i_instances;
|
||||
uint8_t i_records;
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the get asset tag command */
|
||||
struct asset_tag {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t length;
|
||||
const char tag[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the set asset tag command */
|
||||
struct set_asset_tag {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t length;
|
||||
const char tag[16];
|
||||
uint8_t *data;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the get thermal limit command */
|
||||
struct thermal_limit {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t exceptionActions;
|
||||
uint8_t tempLimit;
|
||||
uint16_t exceptionTime;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /*IPMI_DCMI_H*/
|
366
ipmitool/include/ipmitool/ipmi_delloem.h
Normal file
366
ipmitool/include/ipmitool/ipmi_delloem.h
Normal file
@ -0,0 +1,366 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2008, Dell Inc
|
||||
All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Dell Inc nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
*****************************************************************************/
|
||||
#ifndef IPMI_DELLOEM_H
|
||||
#define IPMI_DELLOEM_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
|
||||
/* Dell selector for LCD control - get and set unless specified */
|
||||
#define IPMI_DELL_LCD_STRING_SELECTOR 0xC1 /* RW get/set the user string */
|
||||
#define IPMI_DELL_LCD_CONFIG_SELECTOR 0xC2 /* RW set to user/default/none */
|
||||
#define IPMI_DELL_LCD_GET_CAPS_SELECTOR 0xCF /* RO use when available*/
|
||||
#define IPMI_DELL_LCD_STRINGEX_SELECTOR 0xD0 /* RW get/set the user string use first when available*/
|
||||
#define IPMI_DELL_LCD_STATUS_SELECTOR 0xE7 /* LCD string when config set to default.*/
|
||||
#define IPMI_DELL_PLATFORM_MODEL_NAME_SELECTOR 0xD1 /* LCD string when config set to default.*/
|
||||
|
||||
/* Dell defines for picking which string to use */
|
||||
#define IPMI_DELL_LCD_CONFIG_USER_DEFINED 0x00 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_CONFIG_DEFAULT 0x01 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_CONFIG_NONE 0x02 /* blank*/
|
||||
#define IPMI_DELL_LCD_iDRAC_IPV4ADRESS 0x04 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_IDRAC_MAC_ADDRESS 0x08 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_OS_SYSTEM_NAME 0x10 /* blank*/
|
||||
|
||||
#define IPMI_DELL_LCD_SERVICE_TAG 0x20 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_iDRAC_IPV6ADRESS 0x40 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_AMBEINT_TEMP 0x80 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_SYSTEM_WATTS 0x100 /* blank*/
|
||||
#define IPMI_DELL_LCD_ASSET_TAG 0x200
|
||||
|
||||
#define IPMI_DELL_LCD_ERROR_DISP_SEL 0x01 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_ERROR_DISP_VERBOSE 0x02 /* blank*/
|
||||
|
||||
#define IPMI_DELL_IDRAC_VALIDATOR 0xDD
|
||||
#define IPMI_DELL_POWER_CAP_STATUS 0xBA
|
||||
#define IPMI_DELL_AVG_POWER_CONSMP_HST 0xEB
|
||||
#define IPMI_DELL_PEAK_POWER_CONSMP_HST 0xEC
|
||||
#define SYSTEM_BOARD_SYSTEM_LEVEL_SENSOR_NUM 0x98
|
||||
|
||||
#define IDRAC_11G 1
|
||||
#define IDRAC_12G 2
|
||||
// Return Error code for license
|
||||
#define LICENSE_NOT_SUPPORTED 0x6F
|
||||
#define VFL_NOT_LICENSED 0x33
|
||||
#define btuphr 0x01
|
||||
#define watt 0x00
|
||||
#define IPMI_DELL_POWER_CAP 0xEA
|
||||
#define percent 0x03
|
||||
|
||||
/* Not on all Dell servers. If there, use it.*/
|
||||
typedef struct _tag_ipmi_dell_lcd_caps
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t char_set; /* always 1 for printable ASCII 0x20-0x7E */
|
||||
uint8_t number_lines; /* 0-4, 1 for 9G. 10G tbd */
|
||||
uint8_t max_chars[4]; /* 62 for triathlon, 0 if not present (glacier) */
|
||||
/* [0] is max chars for line 1 */
|
||||
}IPMI_DELL_LCD_CAPS;
|
||||
|
||||
#define IPMI_DELL_LCD_STRING_LENGTH_MAX 62 /* Valid for 9G. Glacier ??. */
|
||||
#define IPMI_DELL_LCD_STRING1_SIZE 14
|
||||
#define IPMI_DELL_LCD_STRINGN_SIZE 16
|
||||
|
||||
/* vFlash subcommands */
|
||||
#define IPMI_GET_EXT_SD_CARD_INFO 0xA4
|
||||
|
||||
|
||||
typedef struct _tag_ipmi_dell_lcd_string
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t data_block_selector; /* 16-byte data block number to access, 0 based.*/
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t encoding : 4; /* 0 is printable ASCII 7-bit */
|
||||
uint8_t length; /* 0 to max chars from lcd caps */
|
||||
uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; /* not zero terminated. */
|
||||
}selector_0_string;
|
||||
uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE];
|
||||
}lcd_string;
|
||||
} __attribute__ ((packed)) IPMI_DELL_LCD_STRING;
|
||||
|
||||
/* Only found on servers with more than 1 line. Use if available. */
|
||||
typedef struct _tag_ipmi_dell_lcd_stringex
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t line_number; /* LCD line number 1 to 4 */
|
||||
uint8_t data_block_selector; /* 16-byte data block number to access, 0 based.*/
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t encoding : 4; /* 0 is printable ASCII 7-bit */
|
||||
uint8_t length; /* 0 to max chars from lcd caps */
|
||||
uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; /* not zero terminated. */
|
||||
} selector_0_string;
|
||||
uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE];
|
||||
} lcd_string;
|
||||
} __attribute__ ((packed)) IPMI_DELL_LCD_STRINGEX;
|
||||
|
||||
|
||||
typedef struct _lcd_status
|
||||
{
|
||||
char parametersel;
|
||||
char vKVM_status;
|
||||
char lock_status;
|
||||
char Resv1;
|
||||
char Resv;
|
||||
} __attribute__ ((packed)) LCD_STATUS;
|
||||
|
||||
typedef struct _lcd_mode
|
||||
{
|
||||
uint8_t parametersel;
|
||||
uint32_t lcdmode;
|
||||
uint16_t lcdquallifier;
|
||||
uint32_t capabilites;
|
||||
uint8_t error_display;
|
||||
uint8_t Resv;
|
||||
} __attribute__ ((packed)) LCD_MODE;
|
||||
|
||||
#define PARAM_REV_OFFSET (uint8_t)(0x1)
|
||||
#define VIRTUAL_MAC_OFFSET (uint8_t)(0x1)
|
||||
|
||||
#define LOM_MACTYPE_ETHERNET 0
|
||||
#define LOM_MACTYPE_ISCSI 1
|
||||
#define LOM_MACTYPE_RESERVED 3
|
||||
|
||||
#define LOM_ETHERNET_ENABLED 0
|
||||
#define LOM_ETHERNET_DISABLED 1
|
||||
#define LOM_ETHERNET_PLAYINGDEAD 2
|
||||
#define LOM_ETHERNET_RESERVED 3
|
||||
|
||||
#define LOM_ACTIVE 1
|
||||
#define LOM_INACTIVE 0
|
||||
|
||||
#define MACADDRESSLENGH 6
|
||||
#define MAX_LOM 8
|
||||
|
||||
|
||||
#define EMB_NIC_MAC_ADDRESS_11G (uint8_t)(0xDA)
|
||||
#define EMB_NIC_MAC_ADDRESS_9G_10G (uint8_t)(0xCB)
|
||||
|
||||
#define IMC_IDRAC_10G (uint8_t) (0x08)
|
||||
#define IMC_CMC (uint8_t) (0x09)
|
||||
#define IMC_IDRAC_11G_MONOLITHIC (uint8_t) (0x0A)
|
||||
#define IMC_IDRAC_11G_MODULAR (uint8_t) (0x0B)
|
||||
#define IMC_UNUSED (uint8_t) (0x0C)
|
||||
#define IMC_MASER_LITE_BMC (uint8_t) (0x0D)
|
||||
#define IMC_MASER_LITE_NU (uint8_t) (0x0E)
|
||||
#define IMC_IDRAC_12G_MONOLITHIC (uint8_t) (0x10)
|
||||
#define IMC_IDRAC_12G_MODULAR (uint8_t) (0x11)
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int BladSlotNumber : 4;
|
||||
unsigned int MacType : 2;
|
||||
unsigned int EthernetStatus : 2;
|
||||
unsigned int NICNumber : 5;
|
||||
unsigned int Reserved : 3;
|
||||
uint8_t MacAddressByte[MACADDRESSLENGH];
|
||||
} LOMMacAddressType;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LOMMacAddressType LOMMacAddress [MAX_LOM];
|
||||
} EmbeddedNICMacAddressType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MacAddressByte[MACADDRESSLENGH];
|
||||
} MacAddressType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MacAddressType MacAddress [MAX_LOM];
|
||||
} EmbeddedNICMacAddressType_10G;
|
||||
|
||||
|
||||
|
||||
#define TRANSPORT_NETFN (uint8_t)(0xc)
|
||||
#define GET_LAN_PARAM_CMD (uint8_t)(0x02)
|
||||
#define MAC_ADDR_PARAM (uint8_t)(0x05)
|
||||
#define LAN_CHANNEL_NUMBER (uint8_t)(0x01)
|
||||
|
||||
#define IDRAC_NIC_NUMBER (uint8_t)(0x8)
|
||||
|
||||
#define TOTAL_N0_NICS_INDEX (uint8_t)(0x1)
|
||||
|
||||
|
||||
// 12g supported
|
||||
#define SET_NIC_SELECTION_12G_CMD (uint8_t)(0x28)
|
||||
#define GET_NIC_SELECTION_12G_CMD (uint8_t)(0x29)
|
||||
|
||||
// 11g supported
|
||||
#define SET_NIC_SELECTION_CMD (uint8_t)(0x24)
|
||||
#define GET_NIC_SELECTION_CMD (uint8_t)(0x25)
|
||||
#define GET_ACTIVE_NIC_CMD (uint8_t)(0xc1)
|
||||
#define POWER_EFFICENCY_CMD (uint8_t)(0xc0)
|
||||
#define SERVER_POWER_CONSUMPTION_CMD (uint8_t)(0x8F)
|
||||
|
||||
#define POWER_SUPPLY_INFO (uint8_t)(0xb0)
|
||||
#define IPMI_ENTITY_ID_POWER_SUPPLY (uint8_t)(0x0a)
|
||||
#define SENSOR_STATE_STR_SIZE (uint8_t)(64)
|
||||
#define SENSOR_NAME_STR_SIZE (uint8_t)(64)
|
||||
|
||||
#define GET_PWRMGMT_INFO_CMD (uint8_t)(0x9C)
|
||||
#define CLEAR_PWRMGMT_INFO_CMD (uint8_t)(0x9D)
|
||||
#define GET_PWR_HEADROOM_CMD (uint8_t)(0xBB)
|
||||
#define GET_PWR_CONSUMPTION_CMD (uint8_t)(0xB3)
|
||||
#define GET_FRONT_PANEL_INFO_CMD (uint8_t)0xb5
|
||||
|
||||
|
||||
typedef struct _ipmi_power_monitor
|
||||
{
|
||||
uint32_t cumStartTime;
|
||||
uint32_t cumReading;
|
||||
uint32_t maxPeakStartTime;
|
||||
uint32_t ampPeakTime;
|
||||
uint16_t ampReading;
|
||||
uint32_t wattPeakTime;
|
||||
uint16_t wattReading;
|
||||
} __attribute__ ((packed)) IPMI_POWER_MONITOR;
|
||||
|
||||
|
||||
#define MAX_POWER_FW_VERSION 8
|
||||
|
||||
typedef struct _ipmi_power_supply_infoo
|
||||
{
|
||||
/*No param_rev it is not a System Information Command */
|
||||
uint16_t ratedWatts;
|
||||
uint16_t ratedAmps;
|
||||
uint16_t ratedVolts;
|
||||
uint32_t vendorid;
|
||||
uint8_t FrimwareVersion[MAX_POWER_FW_VERSION];
|
||||
uint8_t Powersupplytype;
|
||||
uint16_t ratedDCWatts;
|
||||
uint16_t Resv;
|
||||
|
||||
} __attribute__ ((packed)) IPMI_POWER_SUPPLY_INFO;
|
||||
|
||||
|
||||
typedef struct ipmi_power_consumption_data
|
||||
{
|
||||
uint16_t actualpowerconsumption;
|
||||
uint16_t powerthreshold;
|
||||
uint16_t warningthreshold;
|
||||
uint8_t throttlestate;
|
||||
uint16_t maxpowerconsumption;
|
||||
uint16_t throttlepowerconsumption;
|
||||
uint16_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CONSUMPTION_DATA;
|
||||
|
||||
|
||||
typedef struct ipmi_inst_power_consumption_data
|
||||
{
|
||||
uint16_t instanpowerconsumption;
|
||||
uint16_t instanApms;
|
||||
uint16_t resv1;
|
||||
uint8_t resv;
|
||||
} __attribute__ ((packed)) IPMI_INST_POWER_CONSUMPTION_DATA;
|
||||
|
||||
typedef struct _ipmi_avgpower_consump_histroy
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t lastminutepower;
|
||||
uint16_t lasthourpower;
|
||||
uint16_t lastdaypower;
|
||||
uint16_t lastweakpower;
|
||||
|
||||
} __attribute__ ((packed)) IPMI_AVGPOWER_CONSUMP_HISTORY;
|
||||
|
||||
typedef struct _ipmi_power_consump_histroy
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t lastminutepower;
|
||||
uint16_t lasthourpower;
|
||||
uint16_t lastdaypower;
|
||||
uint16_t lastweakpower;
|
||||
uint32_t lastminutepowertime;
|
||||
uint32_t lasthourpowertime;
|
||||
uint32_t lastdaypowertime;
|
||||
uint32_t lastweekpowertime;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CONSUMP_HISTORY;
|
||||
|
||||
|
||||
typedef struct _ipmi_delloem_power_cap
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t PowerCap;
|
||||
uint8_t unit;
|
||||
uint16_t MaximumPowerConsmp;
|
||||
uint16_t MinimumPowerConsmp;
|
||||
uint16_t totalnumpowersupp;
|
||||
uint16_t AvailablePower ;
|
||||
uint16_t SystemThrottling;
|
||||
uint16_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CAP;
|
||||
|
||||
typedef struct _power_headroom
|
||||
{
|
||||
uint16_t instheadroom;
|
||||
uint16_t peakheadroom;
|
||||
} __attribute__ ((packed)) POWER_HEADROOM;
|
||||
|
||||
struct vFlashstr {
|
||||
uint8_t val;
|
||||
const char * str;
|
||||
};
|
||||
typedef struct ipmi_vFlash_extended_info
|
||||
{
|
||||
uint8_t vflashcompcode;
|
||||
uint8_t sdcardstatus;
|
||||
uint32_t sdcardsize;
|
||||
uint32_t sdcardavailsize;
|
||||
uint8_t bootpartion;
|
||||
uint8_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_DELL_SDCARD_INFO;
|
||||
|
||||
|
||||
typedef struct _SensorReadingType
|
||||
{
|
||||
uint8_t sensorReading;
|
||||
uint8_t sensorFlags;
|
||||
uint16_t sensorState;
|
||||
}SensorReadingType;
|
||||
uint16_t compareinputwattage(IPMI_POWER_SUPPLY_INFO* powersupplyinfo, uint16_t inputwattage);
|
||||
int ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /*IPMI_DELLOEM_H*/
|
68
ipmitool/include/ipmitool/ipmi_ekanalyzer.h
Normal file
68
ipmitool/include/ipmitool/ipmi_ekanalyzer.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_EKANALYZER_H
|
||||
#define IPMI_EKANALYZER_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
|
||||
#define RTM_FRU_FILE 0x00
|
||||
#define A1_AMC_FRU_FILE 0x01
|
||||
#define A2_AMC_FRU_FILE 0x02
|
||||
#define A3_AMC_FRU_FILE 0x03
|
||||
#define A4_AMC_FRU_FILE 0x04
|
||||
#define B1_AMC_FRU_FILE 0x05
|
||||
#define B2_AMC_FRU_FILE 0x06
|
||||
#define B3_AMC_FRU_FILE 0x07
|
||||
#define B4_AMC_FRU_FILE 0x08
|
||||
#define ON_CARRIER_FRU_FILE 0x09
|
||||
#define CONFIG_FILE 0x0A
|
||||
#define SHELF_MANAGER_FRU_FILE 0x0B
|
||||
|
||||
#define MIN_ARGUMENT 0x02
|
||||
#define RTM_IPMB_L 0x90
|
||||
|
||||
#define MAX_FILE_NUMBER 8
|
||||
/* this voltag is specified in AMC.0 specification Table 3-10 */
|
||||
#define AMC_VOLTAGE 12 /*volts*/
|
||||
|
||||
#define SIZE_OF_GUID 16
|
||||
#define FRU_RADIAL_IPMB0_LINK_MAPPING 0x15
|
||||
|
||||
int ipmi_ekanalyzer_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_EKANALYZER_H */
|
@ -28,15 +28,14 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_ENTITY_H
|
||||
#define IPMI_ENTITY_H
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct entity_id {
|
||||
uint8_t id; /* physical entity id */
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -46,6 +45,9 @@ struct entity_id {
|
||||
uint8_t instance : 7; /* instance number */
|
||||
uint8_t logical : 1; /* physical/logical */
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#endif /* IPMI_ENTITY_H */
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_EVENT_H
|
||||
@ -45,6 +41,9 @@
|
||||
#define EVENT_DIR_ASSERT 0
|
||||
#define EVENT_DIR_DEASSERT 1
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct platform_event_msg {
|
||||
uint8_t evm_rev;
|
||||
uint8_t sensor_type;
|
||||
@ -57,7 +56,10 @@ struct platform_event_msg {
|
||||
uint8_t event_dir : 1;
|
||||
#endif
|
||||
uint8_t event_data[3];
|
||||
} __attribute__((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
int ipmi_event_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
|
106
ipmitool/include/ipmitool/ipmi_firewall.h
Normal file
106
ipmitool/include/ipmitool/ipmi_firewall.h
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_FIREWALL_H
|
||||
#define IPMI_FIREWALL_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_firewall_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#define BMC_GET_NETFN_SUPPORT 0x09
|
||||
#define BMC_GET_COMMAND_SUPPORT 0x0A
|
||||
#define BMC_GET_COMMAND_SUBFUNCTION_SUPPORT 0x0B
|
||||
#define BMC_GET_CONFIGURABLE_COMMANDS 0x0C
|
||||
#define BMC_GET_CONFIGURABLE_COMMAND_SUBFUNCTIONS 0x0D
|
||||
#define BMC_SET_COMMAND_ENABLES 0x60
|
||||
#define BMC_GET_COMMAND_ENABLES 0x61
|
||||
#define BMC_SET_COMMAND_SUBFUNCTION_ENABLES 0x62
|
||||
#define BMC_GET_COMMAND_SUBFUNCTION_ENABLES 0x63
|
||||
#define BMC_OEM_NETFN_IANA_SUPPORT 0x64
|
||||
|
||||
#define SET_COMMAND_ENABLE_BYTE (BMC_SET_COMMAND_ENABLES / 8)
|
||||
#define SET_COMMAND_ENABLE_BIT (BMC_SET_COMMAND_ENABLES % 8)
|
||||
|
||||
#define MAX_LUN 4
|
||||
#define MAX_NETFN 64
|
||||
#define MAX_NETFN_PAIR (MAX_NETFN/2)
|
||||
#define MAX_COMMAND 256
|
||||
#define MAX_SUBFN 32
|
||||
#define MAX_COMMAND_BYTES (MAX_COMMAND>>3)
|
||||
#define MAX_SUBFN_BYTES (MAX_SUBFN>>3)
|
||||
|
||||
// support is a bitfield with the following bits set...
|
||||
#define BIT_AVAILABLE 0x01
|
||||
#define BIT_CONFIGURABLE 0x02
|
||||
#define BIT_ENABLED 0x04
|
||||
|
||||
extern int verbose;
|
||||
|
||||
struct command_support {
|
||||
unsigned char support;
|
||||
unsigned char version[3];
|
||||
unsigned char subfn_support[MAX_SUBFN_BYTES];
|
||||
unsigned char subfn_config[MAX_SUBFN_BYTES];
|
||||
unsigned char subfn_enable[MAX_SUBFN_BYTES];
|
||||
};
|
||||
struct lun_netfn_support {
|
||||
unsigned char support;
|
||||
struct command_support command[MAX_COMMAND];
|
||||
unsigned char command_mask[MAX_COMMAND_BYTES];
|
||||
unsigned char config_mask[MAX_COMMAND_BYTES];
|
||||
unsigned char enable_mask[MAX_COMMAND_BYTES];
|
||||
};
|
||||
struct lun_support {
|
||||
unsigned char support;
|
||||
struct lun_netfn_support netfn[MAX_NETFN_PAIR];
|
||||
};
|
||||
struct bmc_fn_support {
|
||||
struct lun_support lun[MAX_LUN];
|
||||
};
|
||||
struct ipmi_function_params {
|
||||
int channel;
|
||||
int lun;
|
||||
int netfn;
|
||||
int command;
|
||||
int subfn;
|
||||
unsigned char force;
|
||||
};
|
||||
|
||||
static inline int bit_test(const unsigned char * bf, int n) {
|
||||
return !!(bf[n>>3]&(1<<(n%8)));
|
||||
}
|
||||
static inline void bit_set(unsigned char * bf, int n, int v) {
|
||||
bf[n>>3] = (bf[n>>3] & ~(1<<(n%8))) | ((v?1:0)<<(n%8));
|
||||
}
|
||||
|
||||
#endif /*IPMI_FIREWALL_H */
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_FRU_H
|
||||
@ -67,8 +63,11 @@ enum {
|
||||
struct fru_info {
|
||||
uint16_t size;
|
||||
uint8_t access:1;
|
||||
} __attribute__ ((packed));
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_header {
|
||||
uint8_t version;
|
||||
struct {
|
||||
@ -80,14 +79,17 @@ struct fru_header {
|
||||
} offset;
|
||||
uint8_t pad;
|
||||
uint8_t checksum;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct fru_area_chassis {
|
||||
uint8_t area_ver;
|
||||
uint8_t type;
|
||||
uint16_t area_len;
|
||||
char *part;
|
||||
char *serial;
|
||||
char * part;
|
||||
char * serial;
|
||||
};
|
||||
|
||||
struct fru_area_board {
|
||||
@ -95,26 +97,29 @@ struct fru_area_board {
|
||||
uint8_t lang;
|
||||
uint16_t area_len;
|
||||
uint32_t mfg_date_time;
|
||||
char *mfg;
|
||||
char *prod;
|
||||
char *serial;
|
||||
char *part;
|
||||
char *fru;
|
||||
char * mfg;
|
||||
char * prod;
|
||||
char * serial;
|
||||
char * part;
|
||||
char * fru;
|
||||
};
|
||||
|
||||
struct fru_area_product {
|
||||
uint8_t area_ver;
|
||||
uint8_t lang;
|
||||
uint16_t area_len;
|
||||
char *mfg;
|
||||
char *name;
|
||||
char *part;
|
||||
char *version;
|
||||
char *serial;
|
||||
char *asset;
|
||||
char *fru;
|
||||
char * mfg;
|
||||
char * name;
|
||||
char * part;
|
||||
char * version;
|
||||
char * serial;
|
||||
char * asset;
|
||||
char * fru;
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_header {
|
||||
#define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00
|
||||
#define FRU_RECORD_TYPE_DC_OUTPUT 0x01
|
||||
@ -122,14 +127,20 @@ struct fru_multirec_header {
|
||||
#define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03
|
||||
#define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04
|
||||
#define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05
|
||||
#define FRU_RECORD_TYPE_PICMG_EXTENSION 0xc0
|
||||
#define FRU_RECORD_TYPE_OEM_EXTENSION 0xc0
|
||||
uint8_t type;
|
||||
uint8_t format;
|
||||
uint8_t len;
|
||||
uint8_t record_checksum;
|
||||
uint8_t header_checksum;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_powersupply {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint16_t capacity;
|
||||
@ -172,11 +183,17 @@ struct fru_multirec_powersupply {
|
||||
#endif
|
||||
uint16_t combined_capacity;
|
||||
uint8_t rps_threshold;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static const char *combined_voltage_desc[] __attribute__ ((unused)) = {
|
||||
static const char * combined_voltage_desc[] __attribute__((unused)) = {
|
||||
"12 V", "-12 V", "5 V", "3.3 V"};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_dcoutput {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t standby:1;
|
||||
@ -193,8 +210,14 @@ struct fru_multirec_dcoutput {
|
||||
uint16_t ripple_and_noise;
|
||||
uint16_t min_current;
|
||||
uint16_t max_current;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_dcload {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:4;
|
||||
@ -209,9 +232,15 @@ struct fru_multirec_dcload {
|
||||
uint16_t ripple_and_noise;
|
||||
uint16_t min_current;
|
||||
uint16_t max_current;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct fru_multirec_picmgext_header {
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_oem_header {
|
||||
unsigned char mfg_id[3];
|
||||
#define FRU_PICMG_BACKPLANE_P2P 0x04
|
||||
#define FRU_PICMG_ADDRESS_TABLE 0x10
|
||||
@ -224,17 +253,45 @@ struct fru_multirec_picmgext_header {
|
||||
#define FRU_AMC_CARRIER_P2P 0x18
|
||||
#define FRU_AMC_P2P 0x19
|
||||
#define FRU_AMC_CARRIER_INFO 0x1a
|
||||
#define FRU_UTCA_FRU_INFO_TABLE 0x20
|
||||
#define FRU_UTCA_CARRIER_MNG_IP 0x21
|
||||
#define FRU_UTCA_CARRIER_INFO 0x22
|
||||
#define FRU_UTCA_CARRIER_LOCATION 0x23
|
||||
#define FRU_UTCA_SHMC_IP_LINK 0x24
|
||||
#define FRU_UTCA_POWER_POLICY 0x25
|
||||
#define FRU_UTCA_ACTIVATION 0x26
|
||||
#define FRU_UTCA_PM_CAPABILTY 0x27
|
||||
#define FRU_UTCA_FAN_GEOGRAPHY 0x28
|
||||
#define FRU_UTCA_CLOCK_MAPPING 0x29
|
||||
#define FRU_UTCA_MSG_BRIDGE_POLICY 0x2A
|
||||
#define FRU_UTCA_OEM_MODULE_DESC 0x2B
|
||||
#define FRU_PICMG_CLK_CARRIER_P2P 0x2C
|
||||
#define FRU_PICMG_CLK_CONFIG 0x2D
|
||||
unsigned char record_id;
|
||||
unsigned char record_version;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_guid {
|
||||
unsigned char guid[16];
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_link_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int designator:12;
|
||||
unsigned int desig_channel:6;
|
||||
unsigned int desig_if:2;
|
||||
unsigned int desig_port:4;
|
||||
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
|
||||
@ -251,50 +308,174 @@ struct fru_picmgext_link_desc {
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
|
||||
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
|
||||
unsigned int type:8;
|
||||
unsigned int desig_port:4;
|
||||
unsigned int desig_if:2;
|
||||
unsigned int desig_channel:6;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED 0x00
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 0x01
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS 0x02
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 0x03
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 0x04
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
/* This is used in command, not in FRU */
|
||||
struct fru_picmgext_amc_link_info {
|
||||
unsigned char linkInfo[3];
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_core {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int designator:12;
|
||||
unsigned int type:8;
|
||||
unsigned int ext:4;
|
||||
unsigned int grouping:8;
|
||||
#else
|
||||
unsigned int grouping:8;
|
||||
unsigned int ext:4;
|
||||
unsigned int type:8;
|
||||
unsigned int designator:12;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_extra {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char asymetricMatch:2;
|
||||
unsigned char reserved:6;
|
||||
#else
|
||||
unsigned char reserved:6;
|
||||
unsigned char asymetricMatch:2;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
struct fru_picmgext_amc_link_desc_core core;/* lsb */
|
||||
struct fru_picmgext_amc_link_desc_extra extra;
|
||||
#else
|
||||
struct fru_picmgext_amc_link_desc_extra extra;
|
||||
struct fru_picmgext_amc_link_desc_core core;/* lsb */
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#define FRU_PICMGEXT_OEM_SWFW 0x03
|
||||
#define OEM_SWFW_NBLOCK_OFFSET 0x05
|
||||
#define OEM_SWFW_FIELD_START_OFFSET 0x06
|
||||
|
||||
#define FRU_PICMGEXT_CHN_DESC_RECORD_SIZE 3
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_chn_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char remote_slot:8;
|
||||
unsigned char remote_chn:5;
|
||||
unsigned char local_chn:5;
|
||||
unsigned char:6;
|
||||
unsigned int remote_slot:8;
|
||||
unsigned int remote_chn:5;
|
||||
unsigned int local_chn:5;
|
||||
unsigned int res:14;
|
||||
#else
|
||||
unsigned char:6;
|
||||
unsigned char local_chn:5;
|
||||
unsigned char remote_chn:5;
|
||||
unsigned char remote_slot:8;
|
||||
unsigned int res:14;
|
||||
unsigned int local_chn:5;
|
||||
unsigned int remote_chn:5;
|
||||
unsigned int remote_slot:8;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_slot_desc {
|
||||
unsigned char chan_type;
|
||||
unsigned char slot_addr;
|
||||
unsigned char chn_count;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
|
||||
#define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
|
||||
#define FRU_PICMGEXT_DESIGN_IF_UPDATE_CHANNEL 0x02
|
||||
#define FRU_PICMGEXT_DESIGN_IF_RESERVED 0x03
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_carrier_activation_record {
|
||||
unsigned short max_internal_curr;
|
||||
unsigned char allowance_for_readiness;
|
||||
unsigned char module_activation_record_count;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_activation_record {
|
||||
unsigned char ibmb_addr;
|
||||
unsigned char max_module_curr;
|
||||
unsigned char reserved;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_carrier_p2p_record {
|
||||
unsigned char resource_id;
|
||||
unsigned char p2p_count;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_carrier_p2p_descriptor {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char remote_resource_id;
|
||||
unsigned char remote_resource_id;
|
||||
unsigned short remote_port:5;
|
||||
unsigned short local_port:5;
|
||||
unsigned short reserved:6;
|
||||
@ -302,21 +483,122 @@ struct fru_picmgext_carrier_p2p_descriptor {
|
||||
unsigned short reserved:6;
|
||||
unsigned short local_port:5;
|
||||
unsigned short remote_port:5;
|
||||
unsigned char remote_resource_id;
|
||||
unsigned char remote_resource_id;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static const char *chassis_type_desc[] __attribute__ ((unused)) = {
|
||||
"Unspecified", "Other", "Unknown",
|
||||
"Desktop", "Low Profile Desktop", "Pizza Box",
|
||||
"Mini Tower", "Tower",
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_p2p_record {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char resource_id :4;
|
||||
unsigned char /* reserved */ :3;
|
||||
unsigned char record_type :1;
|
||||
#else
|
||||
unsigned char record_type :1;
|
||||
unsigned char /* reserved */ :3;
|
||||
unsigned char resource_id :4;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE 3
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_channel_desc_record {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int lane0port :5;
|
||||
unsigned int lane1port :5;
|
||||
unsigned int lane2port :5;
|
||||
unsigned int lane3port :5;
|
||||
unsigned int /* reserved */ :12;
|
||||
#else
|
||||
unsigned int /* reserved */ :12;
|
||||
unsigned int lane3port :5;
|
||||
unsigned int lane2port :5;
|
||||
unsigned int lane1port :5;
|
||||
unsigned int lane0port :5;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE 5
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_record {
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE 0x02
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS1 0x03
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS2 0x04
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G1_NSSC 0x00
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G1_SSC 0x01
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G2_NSSC 0x02
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G2_SSC 0x03
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_ETH_1000_BX 0x00
|
||||
#define AMC_LINK_TYPE_EXT_ETH_10G_XAUI 0x01
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_FC 0x00
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_SATA 0x01
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_SAS 0x02
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int channel_id :8;
|
||||
unsigned int port_flag_0 :1;
|
||||
unsigned int port_flag_1 :1;
|
||||
unsigned int port_flag_2 :1;
|
||||
unsigned int port_flag_3 :1;
|
||||
unsigned int type :8;
|
||||
unsigned int type_ext :4;
|
||||
unsigned int group_id :8;
|
||||
unsigned int asym_match :2;
|
||||
unsigned int /* reserved */ :30;
|
||||
#else
|
||||
unsigned int group_id :8;
|
||||
unsigned int type_ext :4;
|
||||
unsigned int type :8;
|
||||
unsigned int port_flag_3 :1;
|
||||
unsigned int port_flag_2 :1;
|
||||
unsigned int port_flag_1 :1;
|
||||
unsigned int port_flag_0 :1;
|
||||
unsigned int channel_id :8;
|
||||
|
||||
unsigned int /* reserved */ :30;
|
||||
unsigned int asym_match :2;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* FRU Board manufacturing date */
|
||||
static const uint64_t secs_from_1970_1996 = 820454400;
|
||||
static const char * chassis_type_desc[] __attribute__((unused)) = {
|
||||
"Unspecified", "Other", "Unknown",
|
||||
"Desktop", "Low Profile Desktop", "Pizza Box",
|
||||
"Mini Tower", "Tower",
|
||||
"Portable", "LapTop", "Notebook", "Hand Held",
|
||||
"Docking Station", "All in One", "Sub Notebook",
|
||||
"Space-saving", "Lunch Box", "Main Server Chassis",
|
||||
"Expansion Chassis", "SubChassis", "Bus Expansion Chassis",
|
||||
"Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis"};
|
||||
"Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis",
|
||||
"Sealed-case PC", "Multi-system Chassis", "CompactPCI",
|
||||
"AdvancedTCA", "Blade", "Blade Enclosure"
|
||||
};
|
||||
|
||||
int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv);
|
||||
int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru);
|
||||
|
||||
#endif /* IPMI_FRU_H */
|
||||
#endif /* IPMI_FRU_H */
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_KFWUM_H
|
||||
|
48
ipmitool/include/ipmitool/ipmi_gendev.h
Normal file
48
ipmitool/include/ipmitool/ipmi_gendev.h
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_GENDEV_H
|
||||
#define IPMI_GENDEV_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <math.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_entity.h>
|
||||
|
||||
int ipmi_gendev_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_GENDEV_H */
|
41
ipmitool/include/ipmitool/ipmi_hpmfwupg.h
Normal file
41
ipmitool/include/ipmitool/ipmi_hpmfwupg.h
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_HPMFWUPG_H
|
||||
#define IPMI_HPMFWUPG_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_KFWUM_H */
|
45
ipmitool/include/ipmitool/ipmi_ime.h
Executable file
45
ipmitool/include/ipmitool/ipmi_ime.h
Executable file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_IME_H
|
||||
#define IPMI_IME_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
int ipmi_ime_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_IME_H */
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_INTF_H
|
||||
@ -97,7 +93,7 @@ struct ipmi_session {
|
||||
socklen_t addrlen;
|
||||
|
||||
/*
|
||||
* This struct holds state data specific to IMPI v2 / RMCP+ sessions
|
||||
* This struct holds state data specific to IPMI v2 / RMCP+ sessions
|
||||
*/
|
||||
struct {
|
||||
enum LANPLUS_SESSION_STATE session_state;
|
||||
@ -110,6 +106,7 @@ struct ipmi_session {
|
||||
uint8_t integrity_alg;
|
||||
uint8_t crypt_alg;
|
||||
uint8_t max_priv_level;
|
||||
uint8_t lookupbit;
|
||||
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
@ -164,18 +161,27 @@ struct ipmi_intf_support {
|
||||
struct ipmi_intf {
|
||||
char name[16];
|
||||
char desc[128];
|
||||
char *devfile;
|
||||
int fd;
|
||||
int opened;
|
||||
int abort;
|
||||
int noanswer;
|
||||
int picmg_avail;
|
||||
IPMI_OEM manufacturer_id;
|
||||
|
||||
struct ipmi_session * session;
|
||||
struct ipmi_oem_handle * oem;
|
||||
struct ipmi_cmd * cmdlist;
|
||||
uint8_t target_ipmb_addr;
|
||||
uint32_t my_addr;
|
||||
uint32_t target_addr;
|
||||
uint8_t target_lun;
|
||||
uint8_t target_channel;
|
||||
uint32_t transit_addr;
|
||||
uint8_t transit_channel;
|
||||
uint8_t channel_buf_size;
|
||||
|
||||
uint8_t devnum;
|
||||
|
||||
int (*setup)(struct ipmi_intf * intf);
|
||||
int (*open)(struct ipmi_intf * intf);
|
||||
@ -185,6 +191,7 @@ struct ipmi_intf {
|
||||
struct ipmi_rs *(*recv_sol)(struct ipmi_intf * intf);
|
||||
struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, struct ipmi_v2_payload * payload);
|
||||
int (*keepalive)(struct ipmi_intf * intf);
|
||||
int (*set_my_addr)(struct ipmi_intf * intf, uint8_t addr);
|
||||
};
|
||||
|
||||
struct ipmi_intf * ipmi_intf_load(char * name);
|
||||
@ -194,6 +201,7 @@ void ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname);
|
||||
void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username);
|
||||
void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password);
|
||||
void ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t privlvl);
|
||||
void ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit);
|
||||
void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id);
|
||||
void ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char);
|
||||
void ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey);
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_ISOL_H
|
||||
@ -45,15 +41,16 @@
|
||||
|
||||
#define ISOL_ENABLE_PARAM 0x01
|
||||
#define ISOL_AUTHENTICATION_PARAM 0x02
|
||||
#define ISOL_ENABLE_FLAG 0x01
|
||||
#define ISOL_PRIVILEGE_LEVEL_USER 0x02
|
||||
|
||||
#define ISOL_BAUD_RATE_PARAM 0x05
|
||||
#define ISOL_BAUD_RATE_9600 0x06
|
||||
#define ISOL_BAUD_RATE_19200 0x07
|
||||
#define ISOL_BAUD_RATE_38400 0x08
|
||||
#define ISOL_BAUD_RATE_57600 0x09
|
||||
#define ISOL_BAUD_RATE_115200 0x0A
|
||||
#define ISOL_PREFERRED_BAUD_RATE 0x07
|
||||
|
||||
#define ISOL_PREFERRED_BAUD_RATE 0x07
|
||||
|
||||
struct isol_config_parameters {
|
||||
uint8_t enabled;
|
||||
uint8_t privilege_level;
|
||||
uint8_t bit_rate;
|
||||
};
|
||||
|
||||
int ipmi_isol_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
|
46
ipmitool/include/ipmitool/ipmi_kontronoem.h
Normal file
46
ipmitool/include/ipmitool/ipmi_kontronoem.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_KONTRONOEM_H
|
||||
#define IPMI_KONTRONOEM_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
int ipmi_kontronoem_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_kontronoem_set_large_buffer(struct ipmi_intf *, unsigned char size);
|
||||
|
||||
#endif /* IPMI_KONTRONOEM_H */
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_LANP_H
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_MAIN_H
|
||||
|
@ -1,21 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_MC_H
|
||||
@ -43,16 +39,22 @@
|
||||
#define BMC_COLD_RESET 0x02
|
||||
#define BMC_WARM_RESET 0x03
|
||||
#define BMC_GET_SELF_TEST 0x04
|
||||
#define BMC_RESET_WATCHDOG_TIMER 0x22
|
||||
#define BMC_SET_WATCHDOG_TIMER 0x24
|
||||
#define BMC_GET_WATCHDOG_TIMER 0x25
|
||||
#define BMC_SET_GLOBAL_ENABLES 0x2e
|
||||
#define BMC_GET_GLOBAL_ENABLES 0x2f
|
||||
#define BMC_GET_GUID 0x37
|
||||
|
||||
int ipmi_mc_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Response data from IPM Get Device ID Command (IPMI rev 1.5, section 17.1)
|
||||
* The following really apply to any IPM device, not just BMCs...
|
||||
* The following really apply to any IPM device, not just BMCs...
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct ipm_devid_rsp {
|
||||
uint8_t device_id;
|
||||
uint8_t device_revision;
|
||||
@ -63,10 +65,13 @@ struct ipm_devid_rsp {
|
||||
uint8_t manufacturer_id[3];
|
||||
uint8_t product_id[2];
|
||||
uint8_t aux_fw_rev[4];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */
|
||||
#define IPM_DEV_DEVICE_ID_REV_MASK (0x07) /* BCD-enoded */
|
||||
#define IPM_DEV_DEVICE_ID_REV_MASK (0x0F) /* BCD-enoded */
|
||||
|
||||
#define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */
|
||||
#define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */
|
||||
@ -84,10 +89,16 @@ struct ipm_devid_rsp {
|
||||
|
||||
#define IPM_DEV_ADTL_SUPPORT_BITS (8)
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct ipm_selftest_rsp {
|
||||
unsigned char code;
|
||||
unsigned char test;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define IPM_SFT_CODE_OK 0x55
|
||||
#define IPM_SFT_CODE_NOT_IMPLEMENTED 0x56
|
||||
@ -104,4 +115,56 @@ struct ipm_selftest_rsp {
|
||||
#define IPM_SELFTEST_FW_BOOTBLOCK 0x02
|
||||
#define IPM_SELFTEST_FW_CORRUPTED 0x01
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct ipm_get_watchdog_rsp {
|
||||
unsigned char timer_use;
|
||||
unsigned char timer_actions;
|
||||
unsigned char pre_timeout;
|
||||
unsigned char timer_use_exp;
|
||||
unsigned char initial_countdown_lsb;
|
||||
unsigned char initial_countdown_msb;
|
||||
unsigned char present_countdown_lsb;
|
||||
unsigned char present_countdown_msb;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define IPM_WATCHDOG_RESET_ERROR 0x80
|
||||
|
||||
#define IPM_WATCHDOG_BIOS_FRB2 0x01
|
||||
#define IPM_WATCHDOG_BIOS_POST 0x02
|
||||
#define IPM_WATCHDOG_OS_LOAD 0x03
|
||||
#define IPM_WATCHDOG_SMS_OS 0x04
|
||||
#define IPM_WATCHDOG_OEM 0x05
|
||||
|
||||
#define IPM_WATCHDOG_NO_ACTION 0x00
|
||||
#define IPM_WATCHDOG_HARD_RESET 0x01
|
||||
#define IPM_WATCHDOG_POWER_DOWN 0x02
|
||||
#define IPM_WATCHDOG_POWER_CYCLE 0x03
|
||||
|
||||
#define IPM_WATCHDOG_CLEAR_OEM 0x20
|
||||
#define IPM_WATCHDOG_CLEAR_SMS_OS 0x10
|
||||
#define IPM_WATCHDOG_CLEAR_OS_LOAD 0x08
|
||||
#define IPM_WATCHDOG_CLEAR_BIOS_POST 0x04
|
||||
#define IPM_WATCHDOG_CLEAR_BIOS_FRB2 0x02
|
||||
|
||||
/* IPMI 2.0 command for system information*/
|
||||
#define IPMI_SET_SYS_INFO 0x58
|
||||
#define IPMI_GET_SYS_INFO 0x59
|
||||
#define IPMI_SYSINFO_SET0_SIZE 14
|
||||
#define IPMI_SYSINFO_SETN_SIZE 16
|
||||
|
||||
#define IPMI_SYSINFO_HOSTNAME 0x02
|
||||
#define IPMI_SYSINFO_PRIMARY_OS_NAME 0x03
|
||||
#define IPMI_SYSINFO_OS_NAME 0x04
|
||||
#define IPMI_SYSINFO_DELL_OS_VERSION 0xe4
|
||||
#define IPMI_SYSINFO_DELL_URL 0xde
|
||||
|
||||
int ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
|
||||
int len, void *buffer);
|
||||
int ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer);
|
||||
|
||||
#endif /*IPMI_MC_H */
|
||||
|
@ -26,10 +26,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_OEM_H
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_PEF_H
|
||||
@ -54,6 +50,9 @@ typedef enum {
|
||||
P_ABLE,
|
||||
} flg_e;
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_table_entry {
|
||||
#define PEF_CONFIG_ENABLED 0x80
|
||||
#define PEF_CONFIG_PRECONFIGURED 0x40
|
||||
@ -94,7 +93,10 @@ struct pef_table_entry {
|
||||
uint8_t event_data_3_AND_mask;
|
||||
uint8_t event_data_3_compare_1;
|
||||
uint8_t event_data_3_compare_2;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct desc_map { /* maps a description to a value/mask */
|
||||
const char *desc;
|
||||
@ -328,6 +330,9 @@ pef_b2s_generic_ER[] __attribute__((unused)) = {
|
||||
#define PEF_B2S_GENERIC_ER_ENTRIES \
|
||||
(sizeof(pef_b2s_generic_ER) / sizeof(pef_b2s_generic_ER[0]))
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_policy_entry {
|
||||
#define PEF_POLICY_ID_MASK 0xf0
|
||||
#define PEF_POLICY_ID_SHIFT 4
|
||||
@ -345,7 +350,10 @@ struct pef_policy_entry {
|
||||
uint8_t chan_dest;
|
||||
#define PEF_POLICY_EVENT_SPECIFIC 0x80
|
||||
uint8_t alert_string_key;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_policies __attribute__((unused)) = {
|
||||
@ -388,6 +396,9 @@ BIT_DESC_MAP_LIST,
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_selector {
|
||||
#define PEF_CFGPARM_ID_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_CFGPARM_ID_SET_IN_PROGRESS 0
|
||||
@ -407,21 +418,36 @@ struct pef_cfgparm_selector {
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_set_in_progress {
|
||||
#define PEF_SET_IN_PROGRESS_COMMIT_WRITE 0x02
|
||||
#define PEF_SET_IN_PROGRESS 0x01
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_control {
|
||||
#define PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY 0x08
|
||||
#define PEF_CONTROL_ENABLE_STARTUP_DELAY 0x04
|
||||
#define PEF_CONTROL_ENABLE_EVENT_MESSAGES 0x02
|
||||
#define PEF_CONTROL_ENABLE 0x01
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_control __attribute__((unused)) = {
|
||||
@ -433,6 +459,9 @@ BIT_DESC_MAP_ALL,
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_action {
|
||||
#define PEF_ACTION_ENABLE_DIAGNOSTIC_INTERRUPT 0x20
|
||||
#define PEF_ACTION_ENABLE_OEM 0x10
|
||||
@ -441,54 +470,114 @@ struct pef_cfgparm_action {
|
||||
#define PEF_ACTION_ENABLE_POWER_DOWN 0x02
|
||||
#define PEF_ACTION_ENABLE_ALERT 0x01
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_startup_delay {
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_startup_delay {
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_filter_table_size {
|
||||
#define PEF_FILTER_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_filter_table_entry {
|
||||
#define PEF_FILTER_TABLE_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
struct pef_table_entry entry;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_filter_table_data_1 {
|
||||
uint8_t data1;
|
||||
uint8_t data2;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_policy_table_size {
|
||||
#define PEF_POLICY_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_policy_table_entry {
|
||||
#define PEF_POLICY_TABLE_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
struct pef_policy_entry entry;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_system_guid {
|
||||
#define PEF_SYSTEM_GUID_USED_IN_PET 0x01
|
||||
uint8_t data1;
|
||||
uint8_t guid[16];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_table_size {
|
||||
#define PEF_ALERT_STRING_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_keys {
|
||||
#define PEF_ALERT_STRING_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
@ -496,16 +585,27 @@ struct pef_cfgparm_alert_string_keys {
|
||||
uint8_t data2;
|
||||
#define PEF_ALERT_STRING_SET_ID_MASK 0x7f
|
||||
uint8_t data3;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_table_entry {
|
||||
uint8_t id;
|
||||
uint8_t blockno;
|
||||
uint8_t block[16];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* PEF - LAN */
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_selector {
|
||||
#define PEF_LAN_CFGPARM_CH_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_LAN_CFGPARM_CH_MASK 0x0f
|
||||
@ -517,13 +617,25 @@ struct pef_lan_cfgparm_selector {
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_size {
|
||||
#define PEF_LAN_DEST_TABLE_SIZE_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_type {
|
||||
#define PEF_LAN_DEST_TYPE_ID_MASK 0x0f
|
||||
uint8_t dest;
|
||||
@ -536,7 +648,10 @@ struct pef_lan_cfgparm_dest_type {
|
||||
uint8_t alert_timeout;
|
||||
#define PEF_LAN_RETRIES_MASK 0x07
|
||||
uint8_t retries;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_lan_desttype __attribute__((unused)) = {
|
||||
@ -548,6 +663,9 @@ BIT_DESC_MAP_LIST,
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_info {
|
||||
#define PEF_LAN_DEST_MASK 0x0f
|
||||
uint8_t dest;
|
||||
@ -559,10 +677,15 @@ struct pef_lan_cfgparm_dest_info {
|
||||
uint8_t gateway;
|
||||
uint8_t ip[4];
|
||||
uint8_t mac[6];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* PEF - Serial/PPP */
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_selector {
|
||||
#define PEF_SERIAL_CFGPARM_CH_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_SERIAL_CFGPARM_CH_MASK 0x0f
|
||||
@ -577,13 +700,25 @@ struct pef_serial_cfgparm_selector {
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dest_size {
|
||||
#define PEF_SERIAL_DEST_TABLE_SIZE_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dest_info {
|
||||
#define PEF_SERIAL_DEST_MASK 0x0f
|
||||
uint8_t dest;
|
||||
@ -612,7 +747,10 @@ struct pef_serial_cfgparm_dest_info {
|
||||
#define PEF_SERIAL_CALLBACK_IPADDR_ID_SHIFT 4
|
||||
#define PEF_SERIAL_CALLBACK_ACCT_ID_MASK 0xf0
|
||||
uint8_t data5;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_serial_desttype __attribute__((unused)) = {
|
||||
@ -627,31 +765,58 @@ BIT_DESC_MAP_LIST,
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dial_string_count {
|
||||
#define PEF_SERIAL_DIAL_STRING_COUNT_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dial_string {
|
||||
#define PEF_SERIAL_DIAL_STRING_MASK 0x0f
|
||||
uint8_t data1;
|
||||
uint8_t data2;
|
||||
uint8_t data3;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_tap_acct_count {
|
||||
#define PEF_SERIAL_TAP_ACCT_COUNT_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_tap_acct_info {
|
||||
uint8_t data1;
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_MASK 0xf0
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_SHIFT 4
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_SVC_SETTINGS_ID_MASK 0x0f
|
||||
uint8_t data2;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_tap_svc_settings {
|
||||
uint8_t data1;
|
||||
#define PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX 0x0
|
||||
@ -662,7 +827,10 @@ struct pef_serial_cfgparm_tap_svc_settings {
|
||||
uint8_t escape_mask[4];
|
||||
uint8_t timeout_parms[3];
|
||||
uint8_t retry_parms[2];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_tap_svc_confirm __attribute__((unused)) = {
|
||||
@ -689,7 +857,7 @@ BIT_DESC_MAP_LIST,
|
||||
struct pef_cfgparm_alert_string_table_size;
|
||||
struct pef_cfgparm_alert_string_keys;
|
||||
struct pef_cfgparm_alert_string_table_entry;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
struct pef_lan_config_parms { /* LAN */
|
||||
struct pef_lan_cfgparm_set_in_progress;
|
||||
@ -712,7 +880,7 @@ BIT_DESC_MAP_LIST,
|
||||
struct pef_lan_cfgparm_destination_count;
|
||||
struct pef_lan_cfgparm_destination_type;
|
||||
struct pef_lan_cfgparm_destination_ipaddr;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
struct pef_serial_config_parms { /* Serial/PPP */
|
||||
struct pef_serial_cfgparm_set_in_progress;
|
||||
@ -764,7 +932,7 @@ BIT_DESC_MAP_LIST,
|
||||
struct pef_serial_cfgparm_ppp_udp_proxy_xmit_bufsize;
|
||||
struct pef_serial_cfgparm_ppp_udp_proxy_recv_bufsize;
|
||||
struct pef_serial_cfgparm_ppp_remote_console_ipaddr;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#endif
|
||||
|
||||
#define IPMI_CMD_GET_PEF_CAPABILITIES 0x10
|
||||
|
@ -1,75 +1,211 @@
|
||||
|
||||
/*
|
||||
(C) Kontron
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_PICMG_H_
|
||||
#define _IPMI_PICMG_H_
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* PICMG commands */
|
||||
#define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
|
||||
#define PICMG_GET_ADDRESS_INFO_CMD 0x01
|
||||
#define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02
|
||||
#define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03
|
||||
#define PICMG_FRU_CONTROL_CMD 0x04
|
||||
#define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05
|
||||
#define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06
|
||||
#define PICMG_SET_FRU_LED_STATE_CMD 0x07
|
||||
#define PICMG_GET_FRU_LED_STATE_CMD 0x08
|
||||
#define PICMG_SET_IPMB_CMD 0x09
|
||||
#define PICMG_SET_FRU_POLICY_CMD 0x0A
|
||||
#define PICMG_GET_FRU_POLICY_CMD 0x0B
|
||||
#define PICMG_FRU_ACTIVATION_CMD 0x0C
|
||||
#define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D
|
||||
#define PICMG_SET_PORT_STATE_CMD 0x0E
|
||||
#define PICMG_GET_PORT_STATE_CMD 0x0F
|
||||
#define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10
|
||||
#define PICMG_SET_POWER_LEVEL_CMD 0x11
|
||||
#define PICMG_GET_POWER_LEVEL_CMD 0x12
|
||||
#define PICMG_RENEGOTIATE_POWER_CMD 0x13
|
||||
#define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14
|
||||
#define PICMG_SET_FAN_LEVEL_CMD 0x15
|
||||
#define PICMG_GET_FAN_LEVEL_CMD 0x16
|
||||
#define PICMG_BUSED_RESOURCE_CMD 0x17
|
||||
|
||||
/* Site Types */
|
||||
#define PICMG_ATCA_BOARD 0x00
|
||||
#define PICMG_POWER_ENTRY 0x01
|
||||
#define PICMG_SHELF_FRU 0x02
|
||||
#define PICMG_DEDICATED_SHMC 0x03
|
||||
#define PICMG_FAN_TRAY 0x04
|
||||
#define PICMG_FAN_FILTER_TRAY 0x05
|
||||
#define PICMG_ALARM 0x06
|
||||
#define PICMG_AMC 0x07
|
||||
#define PICMG_PMC 0x08
|
||||
#define PICMG_RTM 0x09
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
(C) Kontron
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_PICMG_H_
|
||||
#define _IPMI_PICMG_H_
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* PICMG version */
|
||||
#define PICMG_CPCI_MAJOR_VERSION 1
|
||||
#define PICMG_ATCA_MAJOR_VERSION 2
|
||||
#define PICMG_AMC_MAJOR_VERSION 4
|
||||
|
||||
/* PICMG commands */
|
||||
#define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
|
||||
#define PICMG_GET_ADDRESS_INFO_CMD 0x01
|
||||
#define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02
|
||||
#define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03
|
||||
#define PICMG_FRU_CONTROL_CMD 0x04
|
||||
#define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05
|
||||
#define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06
|
||||
#define PICMG_SET_FRU_LED_STATE_CMD 0x07
|
||||
#define PICMG_GET_FRU_LED_STATE_CMD 0x08
|
||||
#define PICMG_SET_IPMB_CMD 0x09
|
||||
#define PICMG_SET_FRU_POLICY_CMD 0x0A
|
||||
#define PICMG_GET_FRU_POLICY_CMD 0x0B
|
||||
#define PICMG_FRU_ACTIVATION_CMD 0x0C
|
||||
#define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D
|
||||
#define PICMG_SET_PORT_STATE_CMD 0x0E
|
||||
#define PICMG_GET_PORT_STATE_CMD 0x0F
|
||||
#define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10
|
||||
#define PICMG_SET_POWER_LEVEL_CMD 0x11
|
||||
#define PICMG_GET_POWER_LEVEL_CMD 0x12
|
||||
#define PICMG_RENEGOTIATE_POWER_CMD 0x13
|
||||
#define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14
|
||||
#define PICMG_SET_FAN_LEVEL_CMD 0x15
|
||||
#define PICMG_GET_FAN_LEVEL_CMD 0x16
|
||||
#define PICMG_BUSED_RESOURCE_CMD 0x17
|
||||
|
||||
/* AMC.0 commands */
|
||||
#define PICMG_AMC_SET_PORT_STATE_CMD 0x19
|
||||
#define PICMG_AMC_GET_PORT_STATE_CMD 0x1A
|
||||
/* AMC.0 R2.0 commands */
|
||||
#define PICMG_AMC_SET_CLK_STATE_CMD 0x2C
|
||||
#define PICMG_AMC_GET_CLK_STATE_CMD 0x2D
|
||||
|
||||
/* Site Types */
|
||||
#define PICMG_ATCA_BOARD 0x00
|
||||
#define PICMG_POWER_ENTRY 0x01
|
||||
#define PICMG_SHELF_FRU 0x02
|
||||
#define PICMG_DEDICATED_SHMC 0x03
|
||||
#define PICMG_FAN_TRAY 0x04
|
||||
#define PICMG_FAN_FILTER_TRAY 0x05
|
||||
#define PICMG_ALARM 0x06
|
||||
#define PICMG_AMC 0x07
|
||||
#define PICMG_PMC 0x08
|
||||
#define PICMG_RTM 0x09
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct picmg_set_fru_activation_cmd {
|
||||
unsigned char picmg_id; /* always 0*/
|
||||
unsigned char fru_id; /* threshold setting mask */
|
||||
unsigned char fru_state; /* fru activation/deactivation */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
unsigned char picmg_id; /* always 0*/
|
||||
unsigned char fru_id; /* threshold setting mask */
|
||||
unsigned char fru_state; /* fru activation/deactivation */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
typedef enum picmg_busres_board_cmd_types {
|
||||
PICMG_BUSRES_BOARD_CMD_QUERY =0,
|
||||
PICMG_BUSRES_BOARD_CMD_RELEASE,
|
||||
PICMG_BUSRES_BOARD_CMD_FORCE,
|
||||
PICMG_BUSRES_BOARD_CMD_BUS_FREE
|
||||
} t_picmg_busres_board_cmd_types ;
|
||||
|
||||
typedef enum picmg_busres_shmc_cmd_types {
|
||||
PICMG_BUSRES_SHMC_CMD_REQUEST =0,
|
||||
PICMG_BUSRES_SHMC_CMD_RELINQUISH,
|
||||
PICMG_BUSRES_SHMC_CMD_NOTIFY
|
||||
} t_picmg_busres_shmc_cmd_types ;
|
||||
|
||||
typedef enum picmg_busres_resource_id {
|
||||
PICMG_BUSRES_METAL_TEST_BUS_1=0,
|
||||
PICMG_BUSRES_METAL_TEST_BUS_2,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_1,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_2,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_3
|
||||
} t_picmg_busres_resource_id;
|
||||
|
||||
/* the LED color capabilities */
|
||||
static unsigned char* led_color_str[] = {
|
||||
"reserved",
|
||||
"BLUE",
|
||||
"RED",
|
||||
"GREEN",
|
||||
"AMBER",
|
||||
"ORANGE",
|
||||
"WHITE",
|
||||
"reserved"
|
||||
};
|
||||
|
||||
|
||||
|
||||
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif
|
||||
static const char* led_color_str[] __attribute__((unused)) = {
|
||||
"reserved",
|
||||
"BLUE",
|
||||
"RED",
|
||||
"GREEN",
|
||||
"AMBER",
|
||||
"ORANGE",
|
||||
"WHITE",
|
||||
"reserved"
|
||||
};
|
||||
|
||||
|
||||
static const char* amc_link_type_str[] __attribute__((unused)) = {
|
||||
"RESERVED",
|
||||
"RESERVED1",
|
||||
"PCI EXPRESS",
|
||||
"ADVANCED SWITCHING1",
|
||||
"ADVANCED SWITCHING2",
|
||||
"ETHERNET",
|
||||
"RAPIDIO",
|
||||
"STORAGE",
|
||||
};
|
||||
|
||||
static const char* amc_link_type_ext_str[][16] __attribute__((unused)) = {
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED */
|
||||
{
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 */
|
||||
{
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS */
|
||||
{
|
||||
"Gen 1 - NSSC",
|
||||
"Gen 1 - SSC",
|
||||
"Gen 2 - NSSC",
|
||||
"Gen 2 - SSC",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 */
|
||||
{
|
||||
"Gen 1 - NSSC",
|
||||
"Gen 1 - SSC",
|
||||
"Gen 2 - NSSC",
|
||||
"Gen 2 - SSC",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 */
|
||||
{
|
||||
"Gen 1 - NSSC",
|
||||
"Gen 1 - SSC",
|
||||
"Gen 2 - NSSC",
|
||||
"Gen 2 - SSC",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET */
|
||||
{
|
||||
"1000BASE-BX (SerDES Gigabit)",
|
||||
"10GBASE-BX410 Gigabit XAUI",
|
||||
"", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO */
|
||||
{
|
||||
"1.25 Gbaud transmission rate",
|
||||
"2.5 Gbaud transmission rate",
|
||||
"3.125 Gbaud transmission rate",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE */
|
||||
{
|
||||
"Fibre Channel",
|
||||
"Serial ATA",
|
||||
"Serial Attached SCSI",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "", "", "", ""
|
||||
}
|
||||
};
|
||||
|
||||
struct sAmcPortState {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned short lane0 : 1;
|
||||
unsigned short lane1 : 1;
|
||||
unsigned short lane2 : 1;
|
||||
unsigned short lane3 : 1;
|
||||
unsigned short type : 8;
|
||||
unsigned short type_ext : 4;
|
||||
unsigned char group_id : 8;
|
||||
#else
|
||||
unsigned char group_id : 8;
|
||||
unsigned short type_ext : 4;
|
||||
unsigned short type : 8;
|
||||
unsigned short lane3 : 1;
|
||||
unsigned short lane2 : 1;
|
||||
unsigned short lane1 : 1;
|
||||
unsigned short lane0 : 1;
|
||||
#endif
|
||||
|
||||
unsigned char state;
|
||||
};
|
||||
|
||||
|
||||
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
|
||||
uint8_t picmg_discover(struct ipmi_intf *intf);
|
||||
uint8_t ipmi_picmg_ipmb_address(struct ipmi_intf *intf);
|
||||
|
||||
#endif
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_RAW_H
|
||||
@ -40,7 +36,9 @@
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, uint8_t wsize, uint8_t rsize);
|
||||
struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
|
||||
uint8_t * wdata, uint8_t wsize, uint8_t rsize);
|
||||
int ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
int ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /* IPMI_RAW_H */
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SDR_H
|
||||
@ -109,6 +105,9 @@ enum {
|
||||
#define GET_SENSOR_READING 0x2d
|
||||
#define GET_SENSOR_TYPE 0x2f
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_repo_info_rs {
|
||||
uint8_t version; /* SDR version (51h) */
|
||||
uint16_t count; /* number of records */
|
||||
@ -116,20 +115,39 @@ struct sdr_repo_info_rs {
|
||||
uint32_t add_stamp; /* last add timestamp */
|
||||
uint32_t erase_stamp; /* last del timestamp */
|
||||
uint8_t op_support; /* supported operations */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
/* builtin (device) sdrs support */
|
||||
struct sdr_device_info_rs {
|
||||
unsigned char count; /* number of records */
|
||||
unsigned char flags; /* flags */
|
||||
unsigned char popChangeInd[3]; /* free space in SDR */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#define GET_SDR_RESERVE_REPO 0x22
|
||||
struct sdr_reserve_repo_rs {
|
||||
uint16_t reserve_id; /* reservation ID */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#define GET_SDR 0x23
|
||||
struct sdr_get_rq {
|
||||
uint16_t reserve_id; /* reservation ID */
|
||||
@ -137,8 +155,14 @@ struct sdr_get_rq {
|
||||
uint8_t offset; /* offset into SDR */
|
||||
#define GET_SDR_ENTIRE_RECORD 0xff
|
||||
uint8_t length; /* length to read */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_get_rs {
|
||||
uint16_t next; /* next record id */
|
||||
uint16_t id; /* record ID */
|
||||
@ -156,15 +180,21 @@ struct sdr_get_rs {
|
||||
#define SDR_RECORD_TYPE_OEM 0xc0
|
||||
uint8_t type; /* record type */
|
||||
uint8_t length; /* remaining record bytes */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_mask {
|
||||
union {
|
||||
struct {
|
||||
uint16_t assert_event; /* assertion event mask */
|
||||
uint16_t deassert_event; /* de-assertion event mask */
|
||||
uint16_t read; /* discrete reaading mask */
|
||||
} discrete;
|
||||
uint16_t read; /* discrete reading mask */
|
||||
} ATTRIBUTE_PACKING discrete;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint16_t reserved:1;
|
||||
@ -236,49 +266,63 @@ struct sdr_record_mask {
|
||||
uint16_t status_unr:1;
|
||||
uint16_t reserved_2:1;
|
||||
#endif
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN /* settable threshold mask */
|
||||
uint8_t reserved:2;
|
||||
uint8_t unr:1;
|
||||
uint8_t ucr:1;
|
||||
uint8_t unc:1;
|
||||
uint8_t lnr:1;
|
||||
uint8_t lcr:1;
|
||||
uint8_t lnc:1;
|
||||
union {
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN /* settable threshold mask */
|
||||
uint16_t reserved:2;
|
||||
uint16_t unr:1;
|
||||
uint16_t ucr:1;
|
||||
uint16_t unc:1;
|
||||
uint16_t lnr:1;
|
||||
uint16_t lcr:1;
|
||||
uint16_t lnc:1;
|
||||
/* padding lower 8 bits */
|
||||
uint16_t readable:8;
|
||||
#else
|
||||
uint8_t lnc:1;
|
||||
uint8_t lcr:1;
|
||||
uint8_t lnr:1;
|
||||
uint8_t unc:1;
|
||||
uint8_t ucr:1;
|
||||
uint8_t unr:1;
|
||||
uint8_t reserved:2;
|
||||
uint16_t readable:8;
|
||||
uint16_t lnc:1;
|
||||
uint16_t lcr:1;
|
||||
uint16_t lnr:1;
|
||||
uint16_t unc:1;
|
||||
uint16_t ucr:1;
|
||||
uint16_t unr:1;
|
||||
uint16_t reserved:2;
|
||||
#endif
|
||||
} set;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN /* readable threshold mask */
|
||||
uint8_t reserved:2;
|
||||
uint8_t unr:1;
|
||||
uint8_t ucr:1;
|
||||
uint8_t unc:1;
|
||||
uint8_t lnr:1;
|
||||
uint8_t lcr:1;
|
||||
uint8_t lnc:1;
|
||||
} ATTRIBUTE_PACKING set;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN /* readable threshold mask */
|
||||
/* padding upper 8 bits */
|
||||
uint16_t settable:8;
|
||||
uint16_t reserved:2;
|
||||
uint16_t unr:1;
|
||||
uint16_t ucr:1;
|
||||
uint16_t unc:1;
|
||||
uint16_t lnr:1;
|
||||
uint16_t lcr:1;
|
||||
uint16_t lnc:1;
|
||||
#else
|
||||
uint8_t lnc:1;
|
||||
uint8_t lcr:1;
|
||||
uint8_t lnr:1;
|
||||
uint8_t unc:1;
|
||||
uint8_t ucr:1;
|
||||
uint8_t unr:1;
|
||||
uint8_t reserved:2;
|
||||
uint16_t lnc:1;
|
||||
uint16_t lcr:1;
|
||||
uint16_t lnr:1;
|
||||
uint16_t unc:1;
|
||||
uint16_t ucr:1;
|
||||
uint16_t unr:1;
|
||||
uint16_t reserved:2;
|
||||
uint16_t settable:8;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING read;
|
||||
} ATTRIBUTE_PACKING;
|
||||
} ATTRIBUTE_PACKING threshold;
|
||||
} ATTRIBUTE_PACKING type;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
} read;
|
||||
} threshold;
|
||||
} type;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sdr_record_compact_sensor {
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_common_sensor {
|
||||
struct {
|
||||
uint8_t owner_id;
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -291,7 +335,7 @@ struct sdr_record_compact_sensor {
|
||||
uint8_t channel:4; /* channel number */
|
||||
#endif
|
||||
uint8_t sensor_num; /* unique sensor number */
|
||||
} keys;
|
||||
} ATTRIBUTE_PACKING keys;
|
||||
|
||||
struct entity_id entity;
|
||||
|
||||
@ -316,7 +360,7 @@ struct sdr_record_compact_sensor {
|
||||
uint8_t scanning:1;
|
||||
uint8_t __reserved:1;
|
||||
#endif
|
||||
} init;
|
||||
} ATTRIBUTE_PACKING init;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t ignore:1;
|
||||
@ -331,9 +375,9 @@ struct sdr_record_compact_sensor {
|
||||
uint8_t rearm:1;
|
||||
uint8_t ignore:1;
|
||||
#endif
|
||||
} capabilities;
|
||||
uint8_t type; /* sensor type */
|
||||
} sensor;
|
||||
} ATTRIBUTE_PACKING capabilities;
|
||||
uint8_t type;
|
||||
} ATTRIBUTE_PACKING sensor;
|
||||
|
||||
uint8_t event_type; /* event/reading type code */
|
||||
|
||||
@ -354,9 +398,23 @@ struct sdr_record_compact_sensor {
|
||||
struct {
|
||||
uint8_t base;
|
||||
uint8_t modifier;
|
||||
} type;
|
||||
} unit;
|
||||
} ATTRIBUTE_PACKING type;
|
||||
} ATTRIBUTE_PACKING unit;
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
/* SDR Record Common Sensor header macros */
|
||||
#define IS_THRESHOLD_SENSOR(s) ((s)->event_type == 1)
|
||||
#define UNITS_ARE_DISCRETE(s) ((s)->unit.analog == 3)
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_compact_sensor {
|
||||
struct sdr_record_common_sensor cmn;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:2;
|
||||
@ -374,21 +432,27 @@ struct sdr_record_compact_sensor {
|
||||
uint8_t mod_offset:7;
|
||||
uint8_t entity_inst:1;
|
||||
#endif
|
||||
} share;
|
||||
} ATTRIBUTE_PACKING share;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
uint8_t positive;
|
||||
uint8_t negative;
|
||||
} hysteresis;
|
||||
} threshold;
|
||||
} ATTRIBUTE_PACKING hysteresis;
|
||||
} ATTRIBUTE_PACKING threshold;
|
||||
|
||||
uint8_t __reserved[3];
|
||||
uint8_t oem; /* reserved for OEM use */
|
||||
uint8_t id_code; /* sensor ID string type/length code */
|
||||
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_eventonly_sensor {
|
||||
struct {
|
||||
uint8_t owner_id;
|
||||
@ -402,7 +466,7 @@ struct sdr_record_eventonly_sensor {
|
||||
uint8_t channel:4; /* channel number */
|
||||
#endif
|
||||
uint8_t sensor_num; /* unique sensor number */
|
||||
} keys;
|
||||
} ATTRIBUTE_PACKING keys;
|
||||
|
||||
struct entity_id entity;
|
||||
|
||||
@ -426,93 +490,23 @@ struct sdr_record_eventonly_sensor {
|
||||
uint8_t mod_offset:7;
|
||||
uint8_t entity_inst:1;
|
||||
#endif
|
||||
} share;
|
||||
} ATTRIBUTE_PACKING share;
|
||||
|
||||
uint8_t __reserved;
|
||||
uint8_t oem; /* reserved for OEM use */
|
||||
uint8_t id_code; /* sensor ID string type/length code */
|
||||
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
|
||||
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_full_sensor {
|
||||
struct {
|
||||
uint8_t owner_id;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t channel:4; /* channel number */
|
||||
uint8_t __reserved:2;
|
||||
uint8_t lun:2; /* sensor owner lun */
|
||||
#else
|
||||
uint8_t lun:2; /* sensor owner lun */
|
||||
uint8_t __reserved:2;
|
||||
uint8_t channel:4; /* channel number */
|
||||
#endif
|
||||
uint8_t sensor_num; /* unique sensor number */
|
||||
} keys;
|
||||
|
||||
struct entity_id entity;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:1;
|
||||
uint8_t scanning:1;
|
||||
uint8_t events:1;
|
||||
uint8_t thresholds:1;
|
||||
uint8_t hysteresis:1;
|
||||
uint8_t type:1;
|
||||
uint8_t event_gen:1;
|
||||
uint8_t sensor_scan:1;
|
||||
#else
|
||||
uint8_t sensor_scan:1;
|
||||
uint8_t event_gen:1;
|
||||
uint8_t type:1;
|
||||
uint8_t hysteresis:1;
|
||||
uint8_t thresholds:1;
|
||||
uint8_t events:1;
|
||||
uint8_t scanning:1;
|
||||
uint8_t __reserved:1;
|
||||
#endif
|
||||
} init;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t ignore:1;
|
||||
uint8_t rearm:1;
|
||||
uint8_t hysteresis:2;
|
||||
uint8_t threshold:2;
|
||||
uint8_t event_msg:2;
|
||||
#else
|
||||
uint8_t event_msg:2;
|
||||
uint8_t threshold:2;
|
||||
uint8_t hysteresis:2;
|
||||
uint8_t rearm:1;
|
||||
uint8_t ignore:1;
|
||||
#endif
|
||||
} capabilities;
|
||||
uint8_t type;
|
||||
} sensor;
|
||||
|
||||
uint8_t event_type; /* event/reading type code */
|
||||
|
||||
struct sdr_record_mask mask;
|
||||
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t analog:2;
|
||||
uint8_t rate:3;
|
||||
uint8_t modifier:2;
|
||||
uint8_t pct:1;
|
||||
#else
|
||||
uint8_t pct:1;
|
||||
uint8_t modifier:2;
|
||||
uint8_t rate:3;
|
||||
uint8_t analog:2;
|
||||
#endif
|
||||
struct {
|
||||
uint8_t base;
|
||||
uint8_t modifier;
|
||||
} type;
|
||||
} unit;
|
||||
struct sdr_record_common_sensor cmn;
|
||||
|
||||
#define SDR_SENSOR_L_LINEAR 0x00
|
||||
#define SDR_SENSOR_L_LN 0x01
|
||||
@ -544,7 +538,7 @@ struct sdr_record_full_sensor {
|
||||
uint8_t normal_min:1; /* normal min field specified */
|
||||
uint8_t __reserved:5;
|
||||
#endif
|
||||
} analog_flag;
|
||||
} ATTRIBUTE_PACKING analog_flag;
|
||||
|
||||
uint8_t nominal_read; /* nominal reading, raw value */
|
||||
uint8_t normal_max; /* normal maximum, raw value */
|
||||
@ -557,23 +551,29 @@ struct sdr_record_full_sensor {
|
||||
uint8_t non_recover;
|
||||
uint8_t critical;
|
||||
uint8_t non_critical;
|
||||
} upper;
|
||||
} ATTRIBUTE_PACKING upper;
|
||||
struct {
|
||||
uint8_t non_recover;
|
||||
uint8_t critical;
|
||||
uint8_t non_critical;
|
||||
} lower;
|
||||
} ATTRIBUTE_PACKING lower;
|
||||
struct {
|
||||
uint8_t positive;
|
||||
uint8_t negative;
|
||||
} hysteresis;
|
||||
} threshold;
|
||||
} ATTRIBUTE_PACKING hysteresis;
|
||||
} ATTRIBUTE_PACKING threshold;
|
||||
uint8_t __reserved[2];
|
||||
uint8_t oem; /* reserved for OEM use */
|
||||
uint8_t id_code; /* sensor ID string type/length code */
|
||||
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_mc_locator {
|
||||
uint8_t dev_slave_addr;
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -598,7 +598,10 @@ struct sdr_record_mc_locator {
|
||||
uint8_t oem;
|
||||
uint8_t id_code;
|
||||
uint8_t id_string[16];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct sdr_record_fru_locator {
|
||||
uint8_t dev_slave_addr;
|
||||
@ -628,8 +631,14 @@ struct sdr_record_fru_locator {
|
||||
uint8_t oem;
|
||||
uint8_t id_code;
|
||||
uint8_t id_string[16];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_generic_locator {
|
||||
uint8_t dev_access_addr;
|
||||
uint8_t dev_slave_addr;
|
||||
@ -656,8 +665,14 @@ struct sdr_record_generic_locator {
|
||||
uint8_t oem;
|
||||
uint8_t id_code;
|
||||
uint8_t id_string[16];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_entity_assoc {
|
||||
struct entity_id entity; /* container entity ID and instance */
|
||||
struct {
|
||||
@ -681,7 +696,10 @@ struct sdr_record_entity_assoc {
|
||||
uint8_t entity_inst_3; /* entity inst 3 | range 2 first instance */
|
||||
uint8_t entity_id_4; /* entity ID 4 | range 2 entity */
|
||||
uint8_t entity_inst_4; /* entity inst 4 | range 2 last instance */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct sdr_record_oem {
|
||||
uint8_t *data;
|
||||
@ -692,6 +710,9 @@ struct sdr_record_oem {
|
||||
* The Get SDR Repository Info response structure
|
||||
* From table 33-3 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_sdr_repository_info_rsp {
|
||||
uint8_t sdr_version;
|
||||
uint8_t record_count_lsb;
|
||||
@ -716,19 +737,30 @@ struct get_sdr_repository_info_rsp {
|
||||
uint8_t modal_update_support:2;
|
||||
uint8_t overflow_flag:1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct ipmi_sdr_iterator {
|
||||
uint16_t reservation;
|
||||
int total;
|
||||
int next;
|
||||
int use_built_in;
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_list {
|
||||
uint16_t id;
|
||||
uint8_t version;
|
||||
uint8_t type;
|
||||
uint8_t length;
|
||||
uint8_t *raw;
|
||||
struct sdr_record_list *next;
|
||||
union {
|
||||
struct sdr_record_common_sensor *common;
|
||||
struct sdr_record_full_sensor *full;
|
||||
struct sdr_record_compact_sensor *compact;
|
||||
struct sdr_record_eventonly_sensor *eventonly;
|
||||
@ -737,8 +769,12 @@ struct sdr_record_list {
|
||||
struct sdr_record_mc_locator *mcloc;
|
||||
struct sdr_record_entity_assoc *entassoc;
|
||||
struct sdr_record_oem *oem;
|
||||
} record;
|
||||
};
|
||||
} ATTRIBUTE_PACKING record;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
/* unit description codes (IPMI v1.5 section 37.16) */
|
||||
#define UNIT_MAX 0x90
|
||||
@ -764,58 +800,119 @@ static const char *unit_desc[] __attribute__ ((unused)) = {
|
||||
"overflow", "underrun", "collision", "packets", "messages",
|
||||
"characters", "error", "correctable error", "uncorrectable error",};
|
||||
|
||||
/* sensor type codes (IPMI v1.5 table 36.3) */
|
||||
#define SENSOR_TYPE_MAX 0x29
|
||||
/* sensor type codes (IPMI v1.5 table 36.3)
|
||||
/ Updated to v2.0 Table 42-3, Sensor Type Codes */
|
||||
#define SENSOR_TYPE_MAX 0x2C
|
||||
static const char *sensor_type_desc[] __attribute__ ((unused)) = {
|
||||
"reserved",
|
||||
"Temperature", "Voltage", "Current", "Fan",
|
||||
"Physical Security", "Platform Security", "Processor",
|
||||
"Power Supply", "Power Unit", "Cooling Device", "Other",
|
||||
"Memory", "Drive Slot / Bay", "POST Memory Resize",
|
||||
"System Firmwares", "Event Logging Disabled", "Watchdog",
|
||||
"System Firmwares", "Event Logging Disabled", "Watchdog1",
|
||||
"System Event", "Critical Interrupt", "Button",
|
||||
"Module / Board", "Microcontroller", "Add-in Card",
|
||||
"Chassis", "Chip Set", "Other FRU", "Cable / Interconnect",
|
||||
"Terminator", "System Boot Initiated", "Boot Error",
|
||||
"OS Boot", "OS Critical Stop", "Slot / Connector",
|
||||
"System ACPI Power State", "Watchdog", "Platform Alert",
|
||||
"System ACPI Power State", "Watchdog2", "Platform Alert",
|
||||
"Entity Presence", "Monitor ASIC", "LAN",
|
||||
"Management Subsystem Health", "Battery"};
|
||||
"Management Subsys Health", "Battery", "Session Audit",
|
||||
"Version Change", "FRU State" };
|
||||
|
||||
struct ipmi_sdr_iterator *ipmi_sdr_start(struct ipmi_intf *intf);
|
||||
struct sensor_reading {
|
||||
char s_id[17]; /* name of the sensor */
|
||||
struct sdr_record_full_sensor *full;
|
||||
struct sdr_record_compact_sensor *compact;
|
||||
uint8_t s_reading_valid; /* read value valididity */
|
||||
uint8_t s_scanning_disabled; /* read of value disabled */
|
||||
uint8_t s_reading_unavailable; /* read value unavailable */
|
||||
uint8_t s_reading; /* value which was read */
|
||||
uint8_t s_data2; /* data2 value read */
|
||||
uint8_t s_data3; /* data3 value read */
|
||||
uint8_t s_has_analog_value; /* sensor has analog value */
|
||||
double s_a_val; /* read value converted to analog */
|
||||
char s_a_str[16]; /* analog value as a string */
|
||||
const char *s_a_units; /* analog value units string */
|
||||
};
|
||||
|
||||
/*
|
||||
* Determine if bridging is necessary to address a sensor at the given
|
||||
* address (_addr) and (_chan) via the interface (_intf).
|
||||
*
|
||||
* If the sensor is being addressed on channel zero, it resides on
|
||||
* IPMB-0. If the interface target IPMB-0 address is exactly the same as
|
||||
* the sensor address then the sensor resides on the target IPMB-0
|
||||
* so we don't need extra levels of bridging to address the sensor.
|
||||
* Or
|
||||
* If the sensor target address and channel match the interface target address
|
||||
* and channel then there is no extra levels of bridging required.
|
||||
*
|
||||
* Note:
|
||||
* The target IPMB-0 address is the address of the SDR repository that was
|
||||
* accessed using the user specified bridging command line arguments.
|
||||
* Access to any sensor on the target IPMB-0 can be addressed using the
|
||||
* target address and transit address in the interface.
|
||||
*/
|
||||
#define BRIDGE_TO_SENSOR(_intf, _addr, _chan) \
|
||||
( !((_chan == 0 && _intf->target_ipmb_addr && \
|
||||
_intf->target_ipmb_addr == _addr) || \
|
||||
(_addr == _intf->target_addr && _chan == _intf->target_channel)) )
|
||||
|
||||
|
||||
struct ipmi_sdr_iterator *ipmi_sdr_start(struct ipmi_intf *intf,
|
||||
int use_builtin);
|
||||
struct sdr_get_rs *ipmi_sdr_get_next_header(struct ipmi_intf *intf,
|
||||
struct ipmi_sdr_iterator *i);
|
||||
uint8_t *ipmi_sdr_get_record(struct ipmi_intf *intf, struct sdr_get_rs *header,
|
||||
struct ipmi_sdr_iterator *i);
|
||||
void ipmi_sdr_end(struct ipmi_intf *intf, struct ipmi_sdr_iterator *i);
|
||||
int ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type);
|
||||
|
||||
int ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf,uint16_t id,
|
||||
uint8_t type,uint8_t * raw);
|
||||
int ipmi_sdr_print_rawentry(struct ipmi_intf *intf, uint8_t type, uint8_t * raw,
|
||||
int len);
|
||||
int ipmi_sdr_print_listentry(struct ipmi_intf *intf,
|
||||
struct sdr_record_list *entry);
|
||||
char *ipmi_sdr_get_unit_string(uint8_t type, uint8_t base, uint8_t modifier);
|
||||
const char *ipmi_sdr_get_status(struct sdr_record_full_sensor *sensor,
|
||||
uint8_t stat);
|
||||
void ipmi_sdr_print_sensor_hysteresis(struct sdr_record_common_sensor *sensor,
|
||||
struct sdr_record_full_sensor *full,
|
||||
uint8_t hysteresis_value,
|
||||
const char *hdrstr);
|
||||
const char *ipmi_sdr_get_unit_string(uint8_t pct, uint8_t type,
|
||||
uint8_t base, uint8_t modifier);
|
||||
struct sensor_reading *
|
||||
ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
|
||||
struct sdr_record_common_sensor *sensor,
|
||||
uint8_t sdr_record_type, int precision);
|
||||
const char *ipmi_sdr_get_thresh_status(struct sensor_reading *sr,
|
||||
const char *invalidstr);
|
||||
const char *ipmi_sdr_get_status(int, const char *, uint8_t stat);
|
||||
double sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor,
|
||||
uint8_t val);
|
||||
double sdr_convert_sensor_reading(struct sdr_record_full_sensor *sensor,
|
||||
uint8_t val);
|
||||
double sdr_convert_sensor_hysterisis(struct sdr_record_full_sensor *sensor,
|
||||
uint8_t val);
|
||||
uint8_t sdr_convert_sensor_value_to_raw(struct sdr_record_full_sensor *sensor,
|
||||
double val);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_reading(struct ipmi_intf *intf,
|
||||
uint8_t sensor);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_reading_ipmb(struct ipmi_intf *intf,
|
||||
uint8_t sensor,
|
||||
uint8_t target);
|
||||
uint8_t target,
|
||||
uint8_t lun,
|
||||
uint8_t channel);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf,
|
||||
uint8_t sensor);
|
||||
uint8_t sensor,
|
||||
uint8_t target, uint8_t lun, uint8_t channel);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf,
|
||||
uint8_t sensor);
|
||||
uint8_t sensor,
|
||||
uint8_t target, uint8_t lun, uint8_t channel);
|
||||
const char *ipmi_sdr_get_sensor_type_desc(const uint8_t type);
|
||||
int ipmi_sdr_get_reservation(struct ipmi_intf *intf, uint16_t * reserve_id);
|
||||
int ipmi_sdr_get_reservation(struct ipmi_intf *intf, int use_builtin,
|
||||
uint16_t * reserve_id);
|
||||
|
||||
int ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
struct sdr_record_full_sensor *sensor);
|
||||
int ipmi_sdr_print_sensor_compact(struct ipmi_intf *intf,
|
||||
struct sdr_record_compact_sensor *sensor);
|
||||
int ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
|
||||
struct sdr_record_eventonly_sensor *sensor);
|
||||
int ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf,
|
||||
@ -831,7 +928,7 @@ int ipmi_sdr_print_sensor_entity_assoc(struct ipmi_intf *intf,
|
||||
struct sdr_record_list *ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf,
|
||||
struct entity_id *entity);
|
||||
struct sdr_record_list *ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf,
|
||||
uint8_t num, uint8_t type);
|
||||
uint16_t gen_id, uint8_t num, uint8_t type);
|
||||
struct sdr_record_list *ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf,
|
||||
uint8_t type);
|
||||
struct sdr_record_list *ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf,
|
||||
@ -845,14 +942,16 @@ int ipmi_sdr_print_info(struct ipmi_intf *intf);
|
||||
void ipmi_sdr_print_discrete_state(const char *desc, uint8_t sensor_type,
|
||||
uint8_t event_type, uint8_t state1,
|
||||
uint8_t state2);
|
||||
void ipmi_sdr_print_discrete_state_mini(const char *separator,
|
||||
void ipmi_sdr_print_discrete_state_mini(const char *header, const char *separator,
|
||||
uint8_t sensor_type, uint8_t event_type,
|
||||
uint8_t state1, uint8_t state2);
|
||||
int ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf,
|
||||
uint8_t sensor_num, uint8_t sensor_type,
|
||||
uint8_t event_type, int numeric_fmt);
|
||||
uint8_t event_type, int numeric_fmt,
|
||||
uint8_t target, uint8_t lun, uint8_t channel);
|
||||
int ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf,
|
||||
uint8_t sensor_num, uint8_t sensor_type,
|
||||
uint8_t event_type, int numeric_fmt);
|
||||
uint8_t event_type, int numeric_fmt,
|
||||
uint8_t target, uint8_t lun, uint8_t channel);
|
||||
|
||||
#endif /* IPMI_SDR_H */
|
||||
|
46
ipmitool/include/ipmitool/ipmi_sdradd.h
Normal file
46
ipmitool/include/ipmitool/ipmi_sdradd.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SDRADD_H
|
||||
#define IPMI_SDRADD_H
|
||||
|
||||
/*
|
||||
* Methods to add SDRs to repository from built-in sensors or files
|
||||
*/
|
||||
int
|
||||
ipmi_sdr_add_from_sensors(struct ipmi_intf *intf, int maxslot);
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_file(struct ipmi_intf *intf, const char *ifile);
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_list(struct ipmi_intf *intf, const char *rangeList);
|
||||
|
||||
#endif /* IPMI_SDRADD_H */
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SEL_H
|
||||
@ -61,12 +57,18 @@ enum {
|
||||
IPMI_EVENT_CLASS_OEM,
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sel_get_rq {
|
||||
uint16_t reserve_id;
|
||||
uint16_t record_id;
|
||||
uint8_t offset;
|
||||
uint8_t length;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct standard_spec_sel_rec{
|
||||
uint32_t timestamp;
|
||||
@ -81,12 +83,31 @@ struct standard_spec_sel_rec{
|
||||
uint8_t event_type : 7;
|
||||
uint8_t event_dir : 1;
|
||||
#endif
|
||||
#define DATA_BYTE2_SPECIFIED_MASK 0xc0 /* event_data[0] bit mask */
|
||||
#define DATA_BYTE3_SPECIFIED_MASK 0x30 /* event_data[0] bit mask */
|
||||
#define EVENT_OFFSET_MASK 0x0f /* event_data[0] bit mask */
|
||||
#define DATA_BYTE2_SPECIFIED_MASK 0xc0 /* event_data[0] bit mask */
|
||||
#define DATA_BYTE3_SPECIFIED_MASK 0x30 /* event_data[0] bit mask */
|
||||
#define EVENT_OFFSET_MASK 0x0f /* event_data[0] bit mask */
|
||||
uint8_t event_data[3];
|
||||
};
|
||||
|
||||
/* Dell Specific MACRO's */
|
||||
#define OEM_CODE_IN_BYTE2 0x80 /* Dell specific OEM Byte in Byte 2 Mask */
|
||||
#define OEM_CODE_IN_BYTE3 0x20 /* Dell specific OEM Byte in Byte 3 Mask */
|
||||
/* MASK MACROS */
|
||||
#define MASK_LOWER_NIBBLE 0x0F
|
||||
#define MASK_HIGHER_NIBBLE 0xF0
|
||||
/*Senosr type Macro's */
|
||||
#define SENSOR_TYPE_MEMORY 0x0C
|
||||
#define SENSOR_TYPE_CRIT_INTR 0x13
|
||||
#define SENSOR_TYPE_EVT_LOG 0x10
|
||||
#define SENSOR_TYPE_SYS_EVENT 0x12
|
||||
#define SENSOR_TYPE_PROCESSOR 0x07
|
||||
#define SENSOR_TYPE_OEM_SEC_EVENT 0xC1
|
||||
#define SENSOR_TYPE_VER_CHANGE 0x2B
|
||||
#define SENSOR_TYPE_FRM_PROG 0x0F
|
||||
#define SENSOR_TYPE_WTDOG 0x23
|
||||
#define SENSOR_TYPE_OEM_NFATAL_ERROR 0xC2
|
||||
#define SENSOR_TYPE_OEM_FATAL_ERROR 0xC3
|
||||
#define SENSOR_TYPE_TXT_CMD_ERROR 0x20
|
||||
/* End of Macro for DELL Specific */
|
||||
#define SEL_OEM_TS_DATA_LEN 6
|
||||
#define SEL_OEM_NOTS_DATA_LEN 13
|
||||
struct oem_ts_spec_sel_rec{
|
||||
@ -99,6 +120,9 @@ struct oem_nots_spec_sel_rec{
|
||||
uint8_t oem_defined[SEL_OEM_NOTS_DATA_LEN];
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sel_event_record {
|
||||
uint16_t record_id;
|
||||
uint8_t record_type;
|
||||
@ -107,7 +131,10 @@ struct sel_event_record {
|
||||
struct oem_ts_spec_sel_rec oem_ts_type;
|
||||
struct oem_nots_spec_sel_rec oem_nots_type;
|
||||
} sel_type;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct ipmi_event_sensor_types {
|
||||
uint8_t code;
|
||||
@ -119,6 +146,84 @@ struct ipmi_event_sensor_types {
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
/* The sel module uses the "iana" number to select the appropriate array at run time
|
||||
This table if for iana number 15000 ( Kontron ), you can add you own OEM sensor types
|
||||
using a similar constuct, look for switch(iana) in ipmi_sel.c
|
||||
*/
|
||||
static struct ipmi_event_sensor_types oem_kontron_event_types[] __attribute__((unused)) = {
|
||||
|
||||
/* event type details uses an oem event type */
|
||||
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
|
||||
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
|
||||
|
||||
{ 0xC1 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Push Button" },
|
||||
{ 0xC1 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Bridge Reset" },
|
||||
{ 0xC1 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Backplane" },
|
||||
{ 0xC1 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Fault" },
|
||||
{ 0xC1 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Healty" },
|
||||
{ 0xC1 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Unknown" },
|
||||
{ 0xC1 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "ITP" },
|
||||
{ 0xC1 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hardware Watchdog" },
|
||||
{ 0xC1 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Software Reset" },
|
||||
|
||||
/* Uses standard digital reading type */
|
||||
{ 0xC2 , 0xFF , 0xff, IPMI_EVENT_CLASS_DIGITAL , "SDRR Init Agent", NULL },
|
||||
|
||||
/* based on PICMG IPMB-0 Link state sensor */
|
||||
{ 0xC3 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Disabled" },
|
||||
{ 0xC3 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Enabled" },
|
||||
|
||||
{ 0xC4 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Push Button" },
|
||||
{ 0xC4 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Power Failure" },
|
||||
{ 0xC4 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Unknown" },
|
||||
{ 0xC4 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Watchdog" },
|
||||
{ 0xC4 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Soft Reset" },
|
||||
{ 0xC4 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Warm Reset" },
|
||||
{ 0xC4 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Cold Reset" },
|
||||
{ 0xC4 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "IPMI Command" },
|
||||
{ 0xC4 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Setup Reset (Save CMOS)" },
|
||||
{ 0xC4 , 0x09 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Power Up Reset" },
|
||||
|
||||
/* event type details uses a standard */
|
||||
{ 0xC5 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Information Agent", NULL },
|
||||
|
||||
{ 0xC6 , 0x0E , 0xff, IPMI_EVENT_CLASS_DISCRETE , "POST Value", "Post Error (see data2)" },
|
||||
|
||||
{ 0xC7 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Upgrade" },
|
||||
{ 0xC7 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Rollback(error)" },
|
||||
{ 0xC7 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Errors (watchdog)" },
|
||||
{ 0xC7 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Manual Rollback" },
|
||||
{ 0xC7 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "Firmware Watchdog Bite, reset occured" },
|
||||
|
||||
{ 0xC8 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Not Loaded" },
|
||||
{ 0xC8 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Initializing" },
|
||||
{ 0xC8 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Ready" },
|
||||
{ 0xC8 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Failure (see data2)" },
|
||||
|
||||
{ 0xC9 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Started" },
|
||||
{ 0xC9 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Pass" },
|
||||
{ 0xC9 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Fail" },
|
||||
|
||||
{ 0xCA , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "In progress"},
|
||||
{ 0xCA , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Success"},
|
||||
{ 0xCA , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Failure"},
|
||||
|
||||
{ 0xCB , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Asserted"},
|
||||
{ 0xCB , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Deasserted"},
|
||||
|
||||
{ 0xCC , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Asserted"},
|
||||
{ 0xCC , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Deasserted"},
|
||||
|
||||
{ 0xCD , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Asserted"},
|
||||
{ 0xCD , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Deasserted"},
|
||||
|
||||
{ 0xCF , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Asserted"},
|
||||
{ 0xCF , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Deasserted"},
|
||||
|
||||
/* END */
|
||||
{ 0x00, 0x00, 0xff, 0x00, NULL, NULL },
|
||||
};
|
||||
|
||||
static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = {
|
||||
/* Threshold Based States */
|
||||
{ 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going low " },
|
||||
@ -485,15 +590,61 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 0x29, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Presence Detected" },
|
||||
|
||||
{ 0x2b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change detected" },
|
||||
{ 0x2b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected" },
|
||||
{ 0x2b, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected" },
|
||||
{ 0x2b, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Id" },
|
||||
{ 0x2b, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Rev" },
|
||||
{ 0x2b, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Rev" },
|
||||
{ 0x2b, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Manuf Id" },
|
||||
{ 0x2b, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl IPMI Vers" },
|
||||
{ 0x2b, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" },
|
||||
{ 0x2b, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" },
|
||||
{ 0x2b, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Other" },
|
||||
{ 0x2b, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, BIOS/EFI change" },
|
||||
{ 0x2b, 0x01, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, SMBIOS change" },
|
||||
{ 0x2b, 0x01, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S change" },
|
||||
{ 0x2b, 0x01, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S loader change" },
|
||||
{ 0x2b, 0x01, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Service Diag change" },
|
||||
{ 0x2b, 0x01, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW agent change" },
|
||||
{ 0x2b, 0x01, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW App change" },
|
||||
{ 0x2b, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW Middle" },
|
||||
{ 0x2b, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Prog HW Change (FPGA)" },
|
||||
{ 0x2b, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU module change" },
|
||||
{ 0x2b, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU component change" },
|
||||
{ 0x2b, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace equ ver" },
|
||||
{ 0x2b, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace new ver" },
|
||||
{ 0x2b, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace old ver" },
|
||||
{ 0x2b, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU HW conf change" },
|
||||
{ 0x2b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware incompatibility detected" },
|
||||
{ 0x2b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software incompatibility detected" },
|
||||
{ 0x2b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported hardware version" },
|
||||
{ 0x2b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported firmware or software version" },
|
||||
{ 0x2b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change success" },
|
||||
{ 0x2b, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success" },
|
||||
{ 0x2b, 0x07, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success" },
|
||||
{ 0x2b, 0x07, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Id" },
|
||||
{ 0x2b, 0x07, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Rev" },
|
||||
{ 0x2b, 0x07, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Rev" },
|
||||
{ 0x2b, 0x07, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Manuf Id" },
|
||||
{ 0x2b, 0x07, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl IPMI Vers" },
|
||||
{ 0x2b, 0x07, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Aux Firm Id" },
|
||||
{ 0x2b, 0x07, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Boot Block" },
|
||||
{ 0x2b, 0x07, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Other" },
|
||||
{ 0x2b, 0x07, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, BIOS/EFI change" },
|
||||
{ 0x2b, 0x07, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, SMBIOS change" },
|
||||
{ 0x2b, 0x07, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S change" },
|
||||
{ 0x2b, 0x07, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S loader change" },
|
||||
{ 0x2b, 0x07, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Service Diag change" },
|
||||
{ 0x2b, 0x07, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW agent change" },
|
||||
{ 0x2b, 0x07, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW App change" },
|
||||
{ 0x2b, 0x07, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW Middle" },
|
||||
{ 0x2b, 0x07, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Prog HW Change (FPGA)" },
|
||||
{ 0x2b, 0x07, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU module change" },
|
||||
{ 0x2b, 0x07, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU component change" },
|
||||
{ 0x2b, 0x07, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace equ ver" },
|
||||
{ 0x2b, 0x07, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace new ver" },
|
||||
{ 0x2b, 0x07, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace old ver" },
|
||||
{ 0x2b, 0x07, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU HW conf change" },
|
||||
|
||||
{ 0x2c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Not Installed" },
|
||||
{ 0x2c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Not Installed" },
|
||||
{ 0x2c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Inactive" },
|
||||
{ 0x2c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation Requested" },
|
||||
{ 0x2c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation in Progress" },
|
||||
@ -509,7 +660,7 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 0xF0, 0x04, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M4" },
|
||||
{ 0xF0, 0x05, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M5" },
|
||||
{ 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M6" },
|
||||
{ 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M7" },
|
||||
{ 0xF0, 0x07, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M7" },
|
||||
|
||||
{ 0xF1, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B disabled" },
|
||||
{ 0xF1, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMB-B disabled" },
|
||||
@ -520,23 +671,11 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 0xF2, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Opened" },
|
||||
{ 0xF2, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Quiesced" },
|
||||
|
||||
{ 0xC0, 0x00, 0xff, 0x00, "OEM", NULL },
|
||||
{ 0xC0, 0x00, 0xff, 0x00, "OEM", "OEM Specific" },
|
||||
|
||||
{ 0x00, 0x00, 0x00, 0x00, NULL, NULL },
|
||||
};
|
||||
|
||||
|
||||
/* These values are IANA numbers */
|
||||
typedef enum IPMI_OEM {
|
||||
IPMI_OEM_UNKNOWN = 0,
|
||||
IPMI_OEM_SUN = 42,
|
||||
IPMI_OEM_INTEL = 343,
|
||||
IPMI_OEM_TYAN = 6653,
|
||||
IPMI_OEM_NEWISYS = 9237,
|
||||
IPMI_OEM_SUPERMICRO = 10876,
|
||||
IPMI_OEM_KONTRON = 15000,
|
||||
} IPMI_OEM;
|
||||
|
||||
int ipmi_sel_main(struct ipmi_intf *, int, char **);
|
||||
void ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
|
||||
void ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
|
||||
@ -549,5 +688,6 @@ uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel
|
||||
char * get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
|
||||
IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf);
|
||||
char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
|
||||
int ipmi_sel_oem_init(const char * filename);
|
||||
|
||||
#endif /* IPMI_SEL_H */
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SENSOR_H
|
||||
@ -69,6 +65,9 @@
|
||||
#define STATE_13_ASSERTED 0x20
|
||||
#define STATE_14_ASSERTED 0x40
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sensor_set_thresh_rq {
|
||||
uint8_t sensor_num; /* sensor # */
|
||||
uint8_t set_mask; /* threshold setting mask */
|
||||
@ -78,11 +77,13 @@ struct sensor_set_thresh_rq {
|
||||
uint8_t upper_non_crit; /* new upper non critical threshold*/
|
||||
uint8_t upper_crit; /* new upper critical threshold*/
|
||||
uint8_t upper_non_recov; /* new upper non recoverable threshold*/
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
int ipmi_sensor_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_sensor_print_full(struct ipmi_intf *, struct sdr_record_full_sensor *);
|
||||
int ipmi_sensor_print_compact(struct ipmi_intf *, struct sdr_record_compact_sensor *);
|
||||
|
||||
int ipmi_sensor_print_fc(struct ipmi_intf *, struct sdr_record_common_sensor *, uint8_t);
|
||||
int ipmi_sensor_get_sensor_reading_factors( struct ipmi_intf * intf, struct sdr_record_full_sensor * sensor, uint8_t reading);
|
||||
#endif /* IPMI_SENSOR_H */
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SESSION_H
|
||||
@ -47,6 +43,9 @@
|
||||
/*
|
||||
* From table 22.25 of the IPMIv2 specification
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_session_info_rsp
|
||||
{
|
||||
uint8_t session_handle;
|
||||
@ -120,7 +119,10 @@ struct get_session_info_rsp
|
||||
uint16_t console_port; /* LSBF */
|
||||
} modem_data;
|
||||
} channel_data;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SOL_H
|
||||
@ -40,6 +36,8 @@
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define SOL_ESCAPE_CHARACTER_DEFAULT '~'
|
||||
#define SOL_KEEPALIVE_TIMEOUT 15
|
||||
#define SOL_KEEPALIVE_RETRIES 3
|
||||
|
||||
#define IPMI_SOL_SERIAL_ALERT_MASK_SUCCEED 0x08
|
||||
#define IPMI_SOL_SERIAL_ALERT_MASK_DEFERRED 0x04
|
||||
@ -69,14 +67,37 @@ struct sol_config_parameters {
|
||||
* The ACTIVATE PAYLOAD command reponse structure
|
||||
* From table 24-2 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef PRAGMA_PACK
|
||||
#pramga pack(1)
|
||||
#endif
|
||||
struct activate_payload_rsp {
|
||||
uint8_t auxiliary_data[4];
|
||||
uint8_t inbound_payload_size[2]; /* LS byte first */
|
||||
uint8_t outbound_payload_size[2]; /* LS byte first */
|
||||
uint8_t payload_udp_port[2]; /* LS byte first */
|
||||
uint8_t payload_vlan_number[2]; /* LS byte first */
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef PRAGMA_PACK
|
||||
#pramga pack(0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Small function to validate that user-supplied SOL
|
||||
* configuration parameter values we store in uint8_t
|
||||
* data type falls within valid range. With minval
|
||||
* and maxval parameters we can use the same function
|
||||
* to validate parameters that have different ranges
|
||||
* of values.
|
||||
*
|
||||
* function will return -1 if value is not valid, or
|
||||
* will return 0 if valid.
|
||||
*/
|
||||
int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
|
||||
const char *name,
|
||||
int base,
|
||||
uint8_t minval,
|
||||
uint8_t maxval,
|
||||
uint8_t *out_value);
|
||||
|
||||
int ipmi_sol_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_get_sol_info(struct ipmi_intf * intf,
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_STRINGS_H
|
||||
@ -45,7 +41,7 @@ extern const struct valstr entity_device_type_vals[];
|
||||
extern const struct valstr ipmi_netfn_vals[];
|
||||
extern const struct valstr ipmi_channel_activity_type_vals[];
|
||||
extern const struct valstr ipmi_privlvl_vals[];
|
||||
extern const struct valstr impi_bit_rate_vals[];
|
||||
extern const struct valstr ipmi_bit_rate_vals[];
|
||||
extern const struct valstr ipmi_set_in_progress_vals[];
|
||||
extern const struct valstr ipmi_authtype_session_vals[];
|
||||
extern const struct valstr ipmi_authtype_vals[];
|
||||
@ -57,5 +53,23 @@ extern const struct valstr ipmi_integrity_algorithms[];
|
||||
extern const struct valstr ipmi_encryption_algorithms[];
|
||||
extern const struct valstr ipmi_oem_info[];
|
||||
|
||||
extern const struct valstr picmg_frucontrol_vals[];
|
||||
extern const struct valstr picmg_clk_family_vals[];
|
||||
extern const struct oemvalstr picmg_clk_accuracy_vals[];
|
||||
extern const struct oemvalstr picmg_clk_resource_vals[];
|
||||
extern const struct oemvalstr picmg_clk_id_vals[];
|
||||
|
||||
extern const struct valstr picmg_busres_id_vals[];
|
||||
extern const struct valstr picmg_busres_board_cmd_vals[];
|
||||
extern const struct valstr picmg_busres_shmc_cmd_vals[];
|
||||
extern const struct oemvalstr picmg_busres_board_status_vals[];
|
||||
extern const struct oemvalstr picmg_busres_shmc_status_vals[];
|
||||
|
||||
/* these are similar, expect that the lookup takes the IANA number
|
||||
as first parameter */
|
||||
extern const struct oemvalstr ipmi_oem_product_info[];
|
||||
extern const struct oemvalstr ipmi_oem_sdr_type_vals[];
|
||||
|
||||
|
||||
|
||||
#endif /*IPMI_STRINGS_H*/
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SUNOEM_H
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_TSOL_H
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_USER_H
|
||||
@ -44,7 +40,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* The GET USER ACCESS response from table 22-32 of the IMPI v2.0 spec
|
||||
* The GET USER ACCESS response from table 22-32 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct user_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -71,6 +67,9 @@ struct user_access_rsp {
|
||||
uint8_t __reserved3 : 2;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved4 : 1;
|
||||
uint8_t no_callin_access : 1;
|
||||
@ -84,7 +83,10 @@ struct user_access_rsp {
|
||||
uint8_t no_callin_access : 1;
|
||||
uint8_t __reserved4 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMITOOL_LOG_H
|
||||
|
@ -27,10 +27,6 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
@ -41,7 +37,10 @@ libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_pef.c \
|
||||
dimm_spd.c ipmi_sensor.c ipmi_channel.c ipmi_event.c \
|
||||
ipmi_session.c ipmi_strings.c ipmi_user.c ipmi_raw.c \
|
||||
ipmi_oem.c ipmi_isol.c ipmi_sunoem.c ipmi_fwum.c ipmi_picmg.c \
|
||||
ipmi_main.c ipmi_tsol.c
|
||||
ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \
|
||||
ipmi_hpmfwupg.c ipmi_sdradd.c ipmi_ekanalyzer.c ipmi_gendev.c \
|
||||
ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c \
|
||||
../src/plugins/lan/md5.c ../src/plugins/lan/md5.h
|
||||
|
||||
libipmitool_la_LDFLAGS = -export-dynamic
|
||||
libipmitool_la_LIBADD = -lm
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
@ -45,10 +41,56 @@
|
||||
|
||||
extern int verbose;
|
||||
|
||||
/*
|
||||
* Also, see ipmi_fru.c.
|
||||
*
|
||||
* Apparently some systems have problems with FRU access greater than 16 bytes
|
||||
* at a time, even when using byte (not word) access. In order to ensure we
|
||||
* work with the widest variety of hardware request size is capped at 16 bytes.
|
||||
* Since this may result in slowdowns on some systems with lots of FRU data you
|
||||
* can change this define to enable larger (up to 32 bytes at a time) access.
|
||||
*/
|
||||
#define FRU_DATA_RQST_SIZE 16;
|
||||
|
||||
const struct valstr spd_memtype_vals[] = {
|
||||
{ 0x01, "STD FPM DRAM" },
|
||||
{ 0x02, "EDO" },
|
||||
{ 0x04, "SDRAM" },
|
||||
{ 0x07, "DDR" },
|
||||
{ 0x05, "ROM" },
|
||||
{ 0x06, "DDR SGRAM" },
|
||||
{ 0x07, "DDR SDRAM" },
|
||||
{ 0x08, "DDR2 SDRAM" },
|
||||
{ 0x09, "DDR2 SDRAM FB-DIMM" },
|
||||
{ 0x0A, "DDR2 SDRAM FB-DIMM Probe" },
|
||||
{ 0x0B, "DDR3 SDRAM" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr ddr3_density_vals[] =
|
||||
{
|
||||
{ 0, "256 Mb" },
|
||||
{ 1, "512 Mb" },
|
||||
{ 2, "1 Gb" },
|
||||
{ 3, "2 Gb" },
|
||||
{ 4, "4 Gb" },
|
||||
{ 5, "8 Gb" },
|
||||
{ 6, "16 Gb" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr ddr3_banks_vals[] =
|
||||
{
|
||||
{ 0, "3 (8 Banks)" },
|
||||
{ 1, "4 (16 Banks)" },
|
||||
{ 2, "5 (32 Banks)" },
|
||||
{ 3, "6 (64 Banks)" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr ddr3_ecc_vals[] =
|
||||
{
|
||||
{ 0, "0 bits" },
|
||||
{ 1, "8 bits" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
@ -56,6 +98,7 @@ const struct valstr spd_config_vals[] = {
|
||||
{ 0x00, "None" },
|
||||
{ 0x01, "Parity" },
|
||||
{ 0x02, "ECC" },
|
||||
{ 0x04, "Addr Cmd Parity" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
@ -65,6 +108,7 @@ const struct valstr spd_voltage_vals[] = {
|
||||
{ 0x02, "HSTL 1.5V" },
|
||||
{ 0x03, "SSTL 3.3V" },
|
||||
{ 0x04, "SSTL 2.5V" },
|
||||
{ 0x05, "SSTL 1.8V" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
@ -673,13 +717,151 @@ const struct valstr jedec_id5_vals[] = {
|
||||
};
|
||||
|
||||
int
|
||||
ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
ipmi_spd_print(uint8_t *spd_data, int len)
|
||||
{
|
||||
int size;
|
||||
|
||||
if (len < 92)
|
||||
return -1; /* we need first 91 bytes to do our thing */
|
||||
|
||||
printf(" Memory Type : %s\n",
|
||||
val2str(spd_data[2], spd_memtype_vals));
|
||||
|
||||
if (spd_data[2] == 0x0B) /* DDR3 SDRAM */
|
||||
{
|
||||
int iPN;
|
||||
char *pchPN = spd_data+128;
|
||||
int sdram_cap = 0;
|
||||
int pri_bus_width = 0;
|
||||
int sdram_width = 0;
|
||||
int ranks = 0;
|
||||
int mem_size = 0;
|
||||
|
||||
if (len < 148)
|
||||
return -1; /* we need first 91 bytes to do our thing */
|
||||
|
||||
|
||||
sdram_cap = ldexp(256,(spd_data[4]&15));
|
||||
pri_bus_width = ldexp(8,(spd_data[8]&7));
|
||||
sdram_width = ldexp(4,(spd_data[7]&7));
|
||||
ranks = ldexp(1,((spd_data[7]&0x3F)>>3));
|
||||
mem_size = (sdram_cap/8) * (pri_bus_width/sdram_width) * ranks;
|
||||
printf(" SDRAM Capacity : %d MB\n", sdram_cap );
|
||||
printf(" Memory Banks : %s\n", val2str(spd_data[4]>>4, ddr3_banks_vals));
|
||||
printf(" Primary Bus Width : %d bits\n", pri_bus_width );
|
||||
printf(" SDRAM Device Width : %d bits\n", sdram_width );
|
||||
printf(" Number of Ranks : %d\n", ranks );
|
||||
printf(" Memory size : %d MB\n", mem_size );
|
||||
|
||||
/* printf(" Memory Density : %s\n", val2str(spd_data[4]&15, ddr3_density_vals)); */
|
||||
printf(" 1.5 V Nominal Op : %s\n", (((spd_data[6]&1) != 0) ? "No":"Yes" ) );
|
||||
printf(" 1.35 V Nominal Op : %s\n", (((spd_data[6]&2) != 0) ? "No":"Yes" ) );
|
||||
printf(" 1.2X V Nominal Op : %s\n", (((spd_data[6]&4) != 0) ? "No":"Yes" ) );
|
||||
printf(" Error Detect/Cor : %s\n", val2str(spd_data[8]>>3, ddr3_ecc_vals));
|
||||
|
||||
printf(" Manufacturer : ");
|
||||
switch (spd_data[117]&127)
|
||||
{
|
||||
case 0:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id1_vals));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id2_vals));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id3_vals));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id4_vals));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id5_vals));
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("%s\n", "JEDEC JEP106 update required" );
|
||||
|
||||
}
|
||||
|
||||
printf(" Manufacture Date : year %c%c week %c%c\n",
|
||||
'0'+(spd_data[120]>>4), '0'+(spd_data[120]&15), '0'+(spd_data[121]>>4), '0'+(spd_data[121]&15) );
|
||||
|
||||
printf(" Serial Number : %02x%02x%02x%02x\n",
|
||||
spd_data[122], spd_data[123], spd_data[124], spd_data[125]);
|
||||
|
||||
printf(" Part Number : ");
|
||||
for (iPN=0; iPN < 19; iPN++)
|
||||
{
|
||||
printf( "%c", *pchPN++ );
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
size = spd_data[5] * (spd_data[31] << 2);
|
||||
printf(" Memory Size : %d MB\n", size);
|
||||
printf(" Voltage Intf : %s\n",
|
||||
val2str(spd_data[8], spd_voltage_vals));
|
||||
printf(" Error Detect/Cor : %s\n",
|
||||
val2str(spd_data[11], spd_config_vals));
|
||||
|
||||
/* handle jedec table bank continuation values */
|
||||
printf(" Manufacturer : ");
|
||||
if (spd_data[64] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[64], jedec_id1_vals));
|
||||
else {
|
||||
if (spd_data[65] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[65], jedec_id2_vals));
|
||||
else {
|
||||
if (spd_data[66] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[66], jedec_id3_vals));
|
||||
else {
|
||||
if (spd_data[67] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[67],
|
||||
jedec_id4_vals));
|
||||
else
|
||||
printf("%s\n",
|
||||
val2str(spd_data[68],
|
||||
jedec_id5_vals));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (spd_data[73]) {
|
||||
char part[19];
|
||||
memcpy(part, spd_data+73, 18);
|
||||
part[18] = 0;
|
||||
printf(" Part Number : %s\n", part);
|
||||
}
|
||||
|
||||
printf(" Serial Number : %02x%02x%02x%02x\n",
|
||||
spd_data[95], spd_data[96], spd_data[97], spd_data[98]);
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
printf("\n");
|
||||
printbuf(spd_data, len, "SPD DATA");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
uint8_t spd_data[256], msg_data[4];
|
||||
int len, offset, size;
|
||||
int len, offset;
|
||||
|
||||
msg_data[0] = id;
|
||||
|
||||
@ -723,7 +905,7 @@ ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
msg_data[0] = id;
|
||||
msg_data[1] = offset;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 32;
|
||||
msg_data[3] = FRU_DATA_RQST_SIZE;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
@ -746,53 +928,8 @@ ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
offset += len;
|
||||
} while (offset < fru.size);
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(spd_data, offset, "SPD DATA");
|
||||
|
||||
if (offset < 92)
|
||||
return -1; /* we need first 91 bytes to do our thing */
|
||||
|
||||
size = spd_data[5] * (spd_data[31] << 2);
|
||||
printf(" Memory Size : %d MB\n", size);
|
||||
printf(" Memory Type : %s\n",
|
||||
val2str(spd_data[2], spd_memtype_vals));
|
||||
printf(" Voltage Intf : %s\n",
|
||||
val2str(spd_data[8], spd_voltage_vals));
|
||||
printf(" Error Detect/Cor : %s\n",
|
||||
val2str(spd_data[11], spd_config_vals));
|
||||
|
||||
/* handle jedec table bank continuation values */
|
||||
printf(" Manufacturer : ");
|
||||
if (spd_data[64] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[64], jedec_id1_vals));
|
||||
else {
|
||||
if (spd_data[65] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[65], jedec_id2_vals));
|
||||
else {
|
||||
if (spd_data[66] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[66], jedec_id3_vals));
|
||||
else {
|
||||
if (spd_data[67] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[67],
|
||||
jedec_id4_vals));
|
||||
else
|
||||
printf("%s\n",
|
||||
val2str(spd_data[68],
|
||||
jedec_id5_vals));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (spd_data[73]) {
|
||||
char part[19];
|
||||
memcpy(part, spd_data+73, 18);
|
||||
part[18] = 0;
|
||||
printf(" Part Number : %s\n", part);
|
||||
}
|
||||
/* now print spd info */
|
||||
ipmi_spd_print(spd_data, offset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -39,6 +35,7 @@
|
||||
#include <sys/ioctl.h> /* For TIOCNOTTY */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <signal.h>
|
||||
@ -53,9 +50,13 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PATHS_H
|
||||
# include <paths.h> /* For _PATH_TTY */
|
||||
# include <paths.h>
|
||||
#else
|
||||
# define _PATH_VARRUN "/var/run/"
|
||||
#endif
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
|
||||
@ -73,13 +74,13 @@ uint16_t buf2short(uint8_t * buf)
|
||||
|
||||
const char * buf2str(uint8_t * buf, int len)
|
||||
{
|
||||
static char str[1024];
|
||||
static char str[2049];
|
||||
int i;
|
||||
|
||||
if (len <= 0 || len > 1024)
|
||||
return NULL;
|
||||
|
||||
memset(str, 0, 1024);
|
||||
memset(str, 0, 2049);
|
||||
|
||||
for (i=0; i<len; i++)
|
||||
sprintf(str+i+i, "%2.2x", buf[i]);
|
||||
@ -110,7 +111,7 @@ void printbuf(const uint8_t * buf, int len, const char * desc)
|
||||
|
||||
const char * val2str(uint16_t val, const struct valstr *vs)
|
||||
{
|
||||
static char un_str[16];
|
||||
static char un_str[32];
|
||||
int i;
|
||||
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
@ -118,12 +119,273 @@ const char * val2str(uint16_t val, const struct valstr *vs)
|
||||
return vs[i].str;
|
||||
}
|
||||
|
||||
memset(un_str, 0, 16);
|
||||
snprintf(un_str, 16, "Unknown (0x%02x)", val);
|
||||
memset(un_str, 0, 32);
|
||||
snprintf(un_str, 32, "Unknown (0x%02X)", val);
|
||||
|
||||
return un_str;
|
||||
}
|
||||
|
||||
const char * oemval2str(uint32_t oem, uint16_t val,
|
||||
const struct oemvalstr *vs)
|
||||
{
|
||||
static char un_str[32];
|
||||
int i;
|
||||
|
||||
for (i = 0; vs[i].oem != 0xffffff && vs[i].str != NULL; i++) {
|
||||
/* FIXME: for now on we assume PICMG capability on all IANAs */
|
||||
if ( (vs[i].oem == oem || vs[i].oem == IPMI_OEM_PICMG) &&
|
||||
vs[i].val == val ) {
|
||||
return vs[i].str;
|
||||
}
|
||||
}
|
||||
|
||||
memset(un_str, 0, 32);
|
||||
snprintf(un_str, 32, "Unknown (0x%X)", val);
|
||||
|
||||
return un_str;
|
||||
}
|
||||
|
||||
/* str2double - safely convert string to double
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @double_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2double(const char * str, double * double_ptr)
|
||||
{
|
||||
char * end_ptr = 0;
|
||||
if (!str || !double_ptr)
|
||||
return (-1);
|
||||
|
||||
*double_ptr = 0;
|
||||
errno = 0;
|
||||
*double_ptr = strtod(str, &end_ptr);
|
||||
|
||||
if (*end_ptr != '\0')
|
||||
return (-2);
|
||||
|
||||
if (errno != 0)
|
||||
return (-3);
|
||||
|
||||
return 0;
|
||||
} /* str2double(...) */
|
||||
|
||||
/* str2long - safely convert string to int64_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @lng_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2long(const char * str, int64_t * lng_ptr)
|
||||
{
|
||||
char * end_ptr = 0;
|
||||
if (!str || !lng_ptr)
|
||||
return (-1);
|
||||
|
||||
*lng_ptr = 0;
|
||||
errno = 0;
|
||||
*lng_ptr = strtol(str, &end_ptr, 0);
|
||||
|
||||
if (*end_ptr != '\0')
|
||||
return (-2);
|
||||
|
||||
if (errno != 0)
|
||||
return (-3);
|
||||
|
||||
return 0;
|
||||
} /* str2long(...) */
|
||||
|
||||
/* str2ulong - safely convert string to uint64_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @ulng_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2ulong(const char * str, uint64_t * ulng_ptr)
|
||||
{
|
||||
char * end_ptr = 0;
|
||||
if (!str || !ulng_ptr)
|
||||
return (-1);
|
||||
|
||||
*ulng_ptr = 0;
|
||||
errno = 0;
|
||||
*ulng_ptr = strtoul(str, &end_ptr, 0);
|
||||
|
||||
if (*end_ptr != '\0')
|
||||
return (-2);
|
||||
|
||||
if (errno != 0)
|
||||
return (-3);
|
||||
|
||||
return 0;
|
||||
} /* str2ulong(...) */
|
||||
|
||||
/* str2int - safely convert string to int32_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @int_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2int(const char * str, int32_t * int_ptr)
|
||||
{
|
||||
int rc = 0;
|
||||
int64_t arg_long = 0;
|
||||
if (!str || !int_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2long(str, &arg_long)) != 0 ) {
|
||||
*int_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_long < INT32_MIN || arg_long > INT32_MAX)
|
||||
return (-3);
|
||||
|
||||
*int_ptr = (int32_t)arg_long;
|
||||
return 0;
|
||||
} /* str2int(...) */
|
||||
|
||||
/* str2uint - safely convert string to uint32_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @uint_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2uint(const char * str, uint32_t * uint_ptr)
|
||||
{
|
||||
int rc = 0;
|
||||
uint64_t arg_ulong = 0;
|
||||
if (!str || !uint_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2ulong(str, &arg_ulong)) != 0) {
|
||||
*uint_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_ulong > UINT32_MAX)
|
||||
return (-3);
|
||||
|
||||
*uint_ptr = (uint32_t)arg_ulong;
|
||||
return 0;
|
||||
} /* str2uint(...) */
|
||||
|
||||
/* str2short - safely convert string to int16_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @shrt_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2short(const char * str, int16_t * shrt_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
int64_t arg_long = 0;
|
||||
if (!str || !shrt_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2long(str, &arg_long)) != 0 ) {
|
||||
*shrt_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_long < INT16_MIN || arg_long > INT16_MAX)
|
||||
return (-3);
|
||||
|
||||
*shrt_ptr = (int16_t)arg_long;
|
||||
return 0;
|
||||
} /* str2short(...) */
|
||||
|
||||
/* str2ushort - safely convert string to uint16_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @ushrt_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2ushort(const char * str, uint16_t * ushrt_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
uint64_t arg_ulong = 0;
|
||||
if (!str || !ushrt_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2ulong(str, &arg_ulong)) != 0 ) {
|
||||
*ushrt_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_ulong > UINT16_MAX)
|
||||
return (-3);
|
||||
|
||||
*ushrt_ptr = (uint16_t)arg_ulong;
|
||||
return 0;
|
||||
} /* str2ushort(...) */
|
||||
|
||||
/* str2char - safely convert string to int8
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @chr_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) or (-3) if conversion fails
|
||||
*/
|
||||
int str2char(const char *str, int8_t * chr_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
int64_t arg_long = 0;
|
||||
if (!str || !chr_ptr) {
|
||||
return (-1);
|
||||
}
|
||||
if ((rc = str2long(str, &arg_long)) != 0) {
|
||||
*chr_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
if (arg_long < INT8_MIN || arg_long > INT8_MAX) {
|
||||
return (-3);
|
||||
}
|
||||
return 0;
|
||||
} /* str2char(...) */
|
||||
|
||||
/* str2uchar - safely convert string to uint8
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @uchr_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) or (-3) if conversion fails
|
||||
*/
|
||||
int str2uchar(const char * str, uint8_t * uchr_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
uint64_t arg_ulong = 0;
|
||||
if (!str || !uchr_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2ulong(str, &arg_ulong)) != 0 ) {
|
||||
*uchr_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_ulong > UINT8_MAX)
|
||||
return (-3);
|
||||
|
||||
*uchr_ptr = (uint8_t)arg_ulong;
|
||||
return 0;
|
||||
} /* str2uchar(...) */
|
||||
|
||||
uint16_t str2val(const char *str, const struct valstr *vs)
|
||||
{
|
||||
int i;
|
||||
@ -152,7 +414,7 @@ print_valstr(const struct valstr * vs, const char * title, int loglevel)
|
||||
|
||||
if (title != NULL) {
|
||||
if (loglevel < 0)
|
||||
printf("\n%s:\n\n");
|
||||
printf("\n%s:\n\n", title);
|
||||
else
|
||||
lprintf(loglevel, "\n%s:\n", title);
|
||||
}
|
||||
@ -201,7 +463,7 @@ print_valstr_2col(const struct valstr * vs, const char * title, int loglevel)
|
||||
|
||||
if (title != NULL) {
|
||||
if (loglevel < 0)
|
||||
printf("\n%s:\n\n");
|
||||
printf("\n%s:\n\n", title);
|
||||
else
|
||||
lprintf(loglevel, "\n%s:\n", title);
|
||||
}
|
||||
@ -279,6 +541,18 @@ ipmi_open_file(const char * file, int rw)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ENABLE_FILE_SECURITY
|
||||
if (!rw) {
|
||||
/* on read skip the extra checks */
|
||||
fp = fopen(file, "r");
|
||||
if (fp == NULL) {
|
||||
lperror(LOG_ERR, "Unable to open file %s", file);
|
||||
return NULL;
|
||||
}
|
||||
return fp;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* it exists - only regular files, not links */
|
||||
if (S_ISREG(st1.st_mode) == 0) {
|
||||
lprintf(LOG_ERR, "File %s has invalid mode: %d",
|
||||
@ -334,7 +608,7 @@ ipmi_open_file(const char * file, int rw)
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_start_daemon(void)
|
||||
ipmi_start_daemon(struct ipmi_intf *intf)
|
||||
{
|
||||
pid_t pid;
|
||||
int fd;
|
||||
@ -342,10 +616,6 @@ ipmi_start_daemon(void)
|
||||
sigset_t sighup;
|
||||
#endif
|
||||
|
||||
/* if we are started from init no need to become daemon */
|
||||
if (getppid() == 1)
|
||||
return;
|
||||
|
||||
#ifdef SIGHUP
|
||||
sigemptyset(&sighup);
|
||||
sigaddset(&sighup, SIGHUP);
|
||||
@ -369,7 +639,7 @@ ipmi_start_daemon(void)
|
||||
pid = (pid_t) fork();
|
||||
if (pid < 0 || pid > 0)
|
||||
exit(0);
|
||||
|
||||
|
||||
#if defined(SIGTSTP) && defined(TIOCNOTTY)
|
||||
if (setpgid(0, getpid()) == -1)
|
||||
exit(1);
|
||||
@ -378,7 +648,7 @@ ipmi_start_daemon(void)
|
||||
close(fd);
|
||||
}
|
||||
#else
|
||||
if (setpgrp() == -1)
|
||||
if (setpgid(0, 0) == -1)
|
||||
exit(1);
|
||||
pid = (pid_t) fork();
|
||||
if (pid < 0 || pid > 0)
|
||||
@ -388,11 +658,101 @@ ipmi_start_daemon(void)
|
||||
chdir("/");
|
||||
umask(0);
|
||||
|
||||
for (fd=0; fd<64; fd++)
|
||||
close(fd);
|
||||
for (fd=0; fd<64; fd++) {
|
||||
if (fd != intf->fd)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
open("/dev/null", O_RDWR);
|
||||
dup(0);
|
||||
dup(0);
|
||||
}
|
||||
|
||||
/* is_fru_id - wrapper for str-2-int FRU ID conversion. Message is printed
|
||||
* on error.
|
||||
* FRU ID range: <0..255>
|
||||
*
|
||||
* @argv_ptr: source string to convert from; usually argv
|
||||
* @fru_id_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) on error and message is printed on STDERR
|
||||
*/
|
||||
int
|
||||
is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr)
|
||||
{
|
||||
if (!argv_ptr || !fru_id_ptr) {
|
||||
lprintf(LOG_ERR, "is_fru_id(): invalid argument(s).");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (str2uchar(argv_ptr, fru_id_ptr) == 0) {
|
||||
return 0;
|
||||
}
|
||||
lprintf(LOG_ERR, "FRU ID '%s' is either invalid or out of range.",
|
||||
argv_ptr);
|
||||
return (-1);
|
||||
} /* is_fru_id(...) */
|
||||
|
||||
/* is_ipmi_channel_num - wrapper for str-2-int Channel conversion. Message is
|
||||
* printed on error.
|
||||
*
|
||||
* 6.3 Channel Numbers, p. 45, IPMIv2 spec.
|
||||
* Valid channel numbers are: <0..7>, <E-F>
|
||||
* Reserved channel numbers: <8-D>
|
||||
*
|
||||
* @argv_ptr: source string to convert from; usually argv
|
||||
* @channel_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) on error and message is printed on STDERR
|
||||
*/
|
||||
int
|
||||
is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr)
|
||||
{
|
||||
if (!argv_ptr || !channel_ptr) {
|
||||
lprintf(LOG_ERR,
|
||||
"is_ipmi_channel_num(): invalid argument(s).");
|
||||
return (-1);
|
||||
}
|
||||
if ((str2uchar(argv_ptr, channel_ptr) == 0)
|
||||
&& ((*channel_ptr >= 0x0 && *channel_ptr <= 0x7)
|
||||
|| (*channel_ptr >= 0xE && *channel_ptr <= 0xF))) {
|
||||
return 0;
|
||||
}
|
||||
lprintf(LOG_ERR,
|
||||
"Given Channel number '%s' is either invalid or out of range.",
|
||||
argv_ptr);
|
||||
lprintf(LOG_ERR, "Channel number must be from ranges: <0..7>, <0xE..0xF>");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* is_ipmi_user_id() - wrapper for str-2-uint IPMI UID conversion. Message is
|
||||
* printed on error.
|
||||
*
|
||||
* @argv_ptr: source string to convert from; usually argv
|
||||
* @ipmi_uid_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) on error and message is printed on STDERR
|
||||
*/
|
||||
int
|
||||
is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr)
|
||||
{
|
||||
if (!argv_ptr || !ipmi_uid_ptr) {
|
||||
lprintf(LOG_ERR,
|
||||
"is_ipmi_user_id(): invalid argument(s).");
|
||||
return (-1);
|
||||
}
|
||||
if ((str2uchar(argv_ptr, ipmi_uid_ptr) == 0)
|
||||
&& *ipmi_uid_ptr >= IPMI_UID_MIN
|
||||
&& *ipmi_uid_ptr <= IPMI_UID_MAX) {
|
||||
return 0;
|
||||
}
|
||||
lprintf(LOG_ERR,
|
||||
"Given User ID '%s' is either invalid or out of range.",
|
||||
argv_ptr);
|
||||
lprintf(LOG_ERR, "User ID is limited to range <%i..%i>.",
|
||||
IPMI_UID_MIN, IPMI_UID_MAX);
|
||||
return (-1);
|
||||
}
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -144,9 +140,9 @@ ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
|
||||
(auth_cap.kg_status) ? "non-zero" : "default (all zeroes)");
|
||||
|
||||
printf("Per message authentication : %sabled\n",
|
||||
(auth_cap.per_message_auth) ? "en" : "dis");
|
||||
(auth_cap.per_message_auth) ? "dis" : "en");
|
||||
printf("User level authentication : %sabled\n",
|
||||
(auth_cap.user_level_auth) ? "en" : "dis");
|
||||
(auth_cap.user_level_auth) ? "dis" : "en");
|
||||
|
||||
printf("Non-null user names exist : %s\n",
|
||||
(auth_cap.non_null_usernames) ? "yes" : "no");
|
||||
@ -175,7 +171,7 @@ ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
|
||||
auth_cap.oem_aux_data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -226,16 +222,16 @@ ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel)
|
||||
|
||||
printf(" Session Support : ");
|
||||
switch (channel_info.session_support) {
|
||||
case 0x00:
|
||||
case 0x0:
|
||||
printf("session-less\n");
|
||||
break;
|
||||
case 0x40:
|
||||
case 0x1:
|
||||
printf("single-session\n");
|
||||
break;
|
||||
case 0x80:
|
||||
case 0x2:
|
||||
printf("multi-session\n");
|
||||
break;
|
||||
case 0xc0:
|
||||
case 0x3:
|
||||
default:
|
||||
printf("session-based\n");
|
||||
break;
|
||||
@ -442,7 +438,7 @@ ipmi_get_user_access(struct ipmi_intf * intf, uint8_t channel, uint8_t userid)
|
||||
static int
|
||||
ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
uint8_t channel, userid;
|
||||
uint8_t channel, privilege_limit, userid;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t rqdata[2];
|
||||
@ -450,13 +446,19 @@ ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
struct set_user_access_data set_access;
|
||||
int i;
|
||||
|
||||
if ((argc < 3) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
if ((argc < 3) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
printf_channel_usage();
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
channel = (uint8_t)strtol(argv[0], NULL, 0);
|
||||
userid = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
if (str2uchar(argv[0], &channel) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[0]);
|
||||
return (-1);
|
||||
}
|
||||
if (str2uchar(argv[1], &userid) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[1]);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
@ -504,7 +506,11 @@ ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
set_access.ipmi_messaging = strncmp (argv[i]+5, "off", 3);
|
||||
}
|
||||
else if (strncmp(argv[i], "privilege=", 10) == 0) {
|
||||
set_access.privilege_limit = strtol (argv[i]+10, NULL, 0);
|
||||
if (str2uchar(argv[i]+10, &privilege_limit) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[i]+10);
|
||||
return (-1);
|
||||
}
|
||||
set_access.privilege_limit = privilege_limit;
|
||||
}
|
||||
else {
|
||||
printf ("Invalid option: %s\n", argv [i]);
|
||||
@ -597,12 +603,10 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf * intf,
|
||||
if (rsp->data_len >= 1)
|
||||
channel = rsp->data[0];
|
||||
|
||||
|
||||
while ((rsp->data_len > 1) && (list_index < 0x3F))
|
||||
while ((rsp->data_len > 1) && (rsp->data_len == 17) && (list_index < 0x3F))
|
||||
{
|
||||
//
|
||||
// We got back cipher suite data -- store it.
|
||||
//
|
||||
//printf("copying data to offset %d\n", offset);
|
||||
//printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data");
|
||||
memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
|
||||
@ -626,6 +630,16 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf * intf,
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy last chunk */
|
||||
if(rsp->data_len > 1)
|
||||
{
|
||||
//
|
||||
// We got back cipher suite data -- store it.
|
||||
//printf("copying data to offset %d\n", offset);
|
||||
//printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data");
|
||||
memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
|
||||
offset += rsp->data_len - 1;
|
||||
}
|
||||
|
||||
//
|
||||
// We can chomp on all our data now.
|
||||
@ -748,7 +762,7 @@ ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel)
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Get Channel Info command failed");
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
if (rsp->ccode == 0xcc)
|
||||
@ -795,6 +809,7 @@ int
|
||||
ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int retval = 0;
|
||||
uint8_t channel, priv = 0;
|
||||
|
||||
if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0))
|
||||
{
|
||||
@ -802,22 +817,38 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
else if (strncmp(argv[0], "authcap", 7) == 0)
|
||||
{
|
||||
if (argc != 3)
|
||||
if (argc != 3) {
|
||||
printf_channel_usage();
|
||||
else
|
||||
retval = ipmi_get_channel_auth_cap(intf,
|
||||
(uint8_t)strtol(argv[1], NULL, 0),
|
||||
(uint8_t)strtol(argv[2], NULL, 0));
|
||||
return (-1);
|
||||
} else {
|
||||
if (str2uchar(argv[1], &channel) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[1]);
|
||||
return (-1);
|
||||
}
|
||||
if (str2uchar(argv[2], &priv) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[2]);
|
||||
return (-1);
|
||||
}
|
||||
retval = ipmi_get_channel_auth_cap(intf, channel, priv);
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "getaccess", 10) == 0)
|
||||
{
|
||||
if ((argc < 2) || (argc > 3))
|
||||
printf_channel_usage();
|
||||
else {
|
||||
uint8_t ch = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
uint8_t ch = 0;
|
||||
uint8_t id = 0;
|
||||
if (argc == 3)
|
||||
id = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
if (str2uchar(argv[1], &ch) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[1]);
|
||||
return (-1);
|
||||
}
|
||||
if (argc == 3) {
|
||||
if (str2uchar(argv[2], &id) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[2]);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
retval = ipmi_get_user_access(intf, ch, id);
|
||||
}
|
||||
}
|
||||
@ -831,8 +862,12 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
printf_channel_usage();
|
||||
else {
|
||||
uint8_t ch = 0xe;
|
||||
if (argc == 2)
|
||||
ch = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
if (argc == 2) {
|
||||
if (str2uchar(argv[1], &ch) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[1]);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
retval = ipmi_get_channel_info(intf, ch);
|
||||
}
|
||||
}
|
||||
@ -846,8 +881,12 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
else
|
||||
{
|
||||
uint8_t ch = 0xe;
|
||||
if (argc == 4)
|
||||
ch = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
if (argc == 3) {
|
||||
if (str2uchar(argv[2], &ch) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[2]);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
retval = ipmi_get_channel_cipher_suites(intf,
|
||||
argv[1], // ipmi | sol
|
||||
ch);
|
||||
@ -862,4 +901,3 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -28,16 +28,14 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/log.h>
|
||||
@ -65,7 +63,7 @@ ipmi_chassis_power_status(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Power Status failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -100,18 +98,18 @@ ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl)
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to set Chassis Power Control to %s",
|
||||
val2str(ctl, ipmi_chassis_power_control_vals));
|
||||
val2str(ctl, ipmi_chassis_power_control_vals));
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Power Control to %s failed: %s",
|
||||
val2str(ctl, ipmi_chassis_power_control_vals),
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(ctl, ipmi_chassis_power_control_vals),
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Chassis Power Control: %s\n",
|
||||
val2str(ctl, ipmi_chassis_power_control_vals));
|
||||
val2str(ctl, ipmi_chassis_power_control_vals));
|
||||
|
||||
#if 0 /* this can cause sessions to hang around after power commands */
|
||||
/* sessions often get lost when changing chassis power */
|
||||
@ -126,11 +124,12 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
{
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_rs * rsp;
|
||||
int rc = (-3);
|
||||
|
||||
struct {
|
||||
uint8_t interval;
|
||||
uint8_t force_on;
|
||||
} identify_data;
|
||||
} identify_data = { .interval = 0, .force_on = 0 };
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
@ -138,18 +137,23 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
|
||||
if (arg != NULL) {
|
||||
if (strncmp(arg, "force", 5) == 0) {
|
||||
identify_data.interval = 0;
|
||||
identify_data.force_on = 1;
|
||||
} else {
|
||||
identify_data.interval = (uint8_t)atoi(arg);
|
||||
identify_data.force_on = 0;
|
||||
if ( (rc = str2uchar(arg, &identify_data.interval)) != 0) {
|
||||
if (rc == (-2)) {
|
||||
lprintf(LOG_ERR, "Invalid interval given.");
|
||||
} else {
|
||||
lprintf(LOG_ERR, "Given interval is too big.");
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
req.msg.data = (uint8_t *)&identify_data;
|
||||
/* The Force Identify On byte is optional and not
|
||||
* supported by all devices-- if force is not specified,
|
||||
* we pass only one data byte; if specified, we pass two
|
||||
* data bytes and check for an error completion code
|
||||
*/
|
||||
*/
|
||||
req.msg.data_len = (identify_data.force_on) ? 2 : 1;
|
||||
}
|
||||
|
||||
@ -160,7 +164,7 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Identify failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
if (identify_data.force_on != 0) {
|
||||
/* Intel SE7501WV2 F/W 1.2 returns CC 0xC7, but
|
||||
* the IPMI v1.5 spec does not standardize a CC
|
||||
@ -176,7 +180,7 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
printf("default (15 seconds)\n");
|
||||
} else {
|
||||
if (identify_data.force_on != 0) {
|
||||
printf("indefinate\n");
|
||||
printf("indefinite\n");
|
||||
} else {
|
||||
if (identify_data.interval == 0)
|
||||
printf("off\n");
|
||||
@ -192,7 +196,10 @@ ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t mins_per_count;
|
||||
uint32_t count;
|
||||
float minutes;
|
||||
uint32_t days, hours;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
@ -205,14 +212,28 @@ ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Power-On-Hours failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
mins_per_count = rsp->data[0];
|
||||
memcpy(&count, rsp->data+1, 4);
|
||||
#if WORDS_BIGENDIAN
|
||||
count = BSWAP_32(count);
|
||||
#endif
|
||||
|
||||
printf("POH Counter : %li hours total (%li days, %li hours)\n",
|
||||
(long)count, (long)(count / 24), (long)(count % 24));
|
||||
minutes = (float)count * mins_per_count;
|
||||
days = minutes / 1440;
|
||||
minutes -= (float)days * 1440;
|
||||
hours = minutes / 60;
|
||||
minutes -= hours * 60;
|
||||
|
||||
if (mins_per_count < 60) {
|
||||
printf("POH Counter : %i days, %i hours, %li minutes\n",
|
||||
days, hours, (long)minutes);
|
||||
} else {
|
||||
printf("POH Counter : %i days, %i hours\n", days, hours);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -234,7 +255,7 @@ ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Restart Cause failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -278,7 +299,7 @@ ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
@ -295,7 +316,7 @@ ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error sending Chassis Status command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -341,7 +362,7 @@ ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
printf("Drive Fault : %s\n", (rsp->data[2] & 0x4) ? "true" : "false");
|
||||
printf("Cooling/Fan Fault : %s\n", (rsp->data[2] & 0x8) ? "true" : "false");
|
||||
|
||||
if (rsp->data_len > 3) {
|
||||
if (rsp->data_len > 3) {
|
||||
/* optional byte 4 */
|
||||
if (rsp->data[3] == 0) {
|
||||
printf("Front Panel Control : none\n");
|
||||
@ -350,12 +371,12 @@ ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
printf("Diag Button Disable : %s\n", (rsp->data[3] & 0x40) ? "allowed" : "not allowed");
|
||||
printf("Reset Button Disable : %s\n", (rsp->data[3] & 0x20) ? "allowed" : "not allowed");
|
||||
printf("Power Button Disable : %s\n", (rsp->data[3] & 0x10) ? "allowed" : "not allowed");
|
||||
printf("Sleep Button Disabled: %s\n", (rsp->data[3] & 0x80) ? "true" : "false");
|
||||
printf("Diag Button Disabled : %s\n", (rsp->data[3] & 0x40) ? "true" : "false");
|
||||
printf("Reset Button Disabled: %s\n", (rsp->data[3] & 0x20) ? "true" : "false");
|
||||
printf("Power Button Disabled: %s\n", (rsp->data[3] & 0x10) ? "true" : "false");
|
||||
printf("Sleep Button Disabled: %s\n", (rsp->data[3] & 0x08) ? "true" : "false");
|
||||
printf("Diag Button Disabled : %s\n", (rsp->data[3] & 0x04) ? "true" : "false");
|
||||
printf("Reset Button Disabled: %s\n", (rsp->data[3] & 0x02) ? "true" : "false");
|
||||
printf("Power Button Disabled: %s\n", (rsp->data[3] & 0x01) ? "true" : "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -378,7 +399,7 @@ ipmi_chassis_selftest(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error sending Get Self Test command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -410,7 +431,7 @@ ipmi_chassis_selftest(struct ipmi_intf * intf)
|
||||
for (i=0; i<8; i++) {
|
||||
if (rsp->data[1] & (1<<i)) {
|
||||
printf(" [%s]\n",
|
||||
val2str(i, broken_dev_vals));
|
||||
val2str(i, broken_dev_vals));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -422,7 +443,7 @@ ipmi_chassis_selftest(struct ipmi_intf * intf)
|
||||
|
||||
default:
|
||||
printf("Device-specific failure %02xh:%02xh\n",
|
||||
rsp->data[0], rsp->data[1]);
|
||||
rsp->data[0], rsp->data[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -452,8 +473,10 @@ ipmi_chassis_set_bootparam(struct ipmi_intf * intf, uint8_t param, uint8_t * dat
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
if (param != 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -467,13 +490,20 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[3];
|
||||
uint8_t param_id = 0;
|
||||
|
||||
if (arg == NULL)
|
||||
return -1;
|
||||
|
||||
if (str2uchar(arg, ¶m_id) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter '%s' given instead of bootparam.",
|
||||
arg);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
memset(msg_data, 0, 3);
|
||||
|
||||
msg_data[0] = (uint8_t)atoi(arg) & 0x7f;
|
||||
msg_data[0] = param_id & 0x7f;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
|
||||
@ -490,71 +520,342 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Boot Parameter %s failed: %s",
|
||||
arg, val2str(rsp->ccode, completion_code_vals));
|
||||
arg, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, "Boot Option");
|
||||
|
||||
param_id = 0;
|
||||
param_id = (rsp->data[1] & 0x7f);
|
||||
|
||||
printf("Boot parameter version: %d\n", rsp->data[0]);
|
||||
printf("Boot parameter %d is %s\n", rsp->data[1] & 0x7f,
|
||||
(rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
|
||||
(rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
|
||||
printf("Boot parameter data: %s\n", buf2str(rsp->data+2, rsp->data_len - 2));
|
||||
|
||||
switch(param_id)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
printf(" Set In Progress : ");
|
||||
switch((rsp->data[2]) &0x03)
|
||||
{
|
||||
case 0: printf("set complete\n"); break;
|
||||
case 1: printf("set in progress\n"); break;
|
||||
case 2: printf("commit write\n"); break;
|
||||
default: printf("error, reserved bit\n"); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
printf(" Service Partition Selector : ");
|
||||
if((rsp->data[2]) == 0)
|
||||
{
|
||||
printf("unspecified\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%d\n",(rsp->data[2]));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
printf( " Service Partition Scan :\n");
|
||||
if((rsp->data[2]&0x03) != 0)
|
||||
{
|
||||
if((rsp->data[2]&0x01) == 0x01)
|
||||
printf(" - Request BIOS to scan\n");
|
||||
if((rsp->data[2]&0x02) == 0x02)
|
||||
printf(" - Service Partition Discovered\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
printf( " BMC boot flag valid bit clearing :\n");
|
||||
if((rsp->data[2]&0x1f) != 0)
|
||||
{
|
||||
if((rsp->data[2]&0x10) == 0x10)
|
||||
printf(" - Don't clear valid bit on reset/power cycle cause by PEF\n");
|
||||
if((rsp->data[2]&0x08) == 0x08)
|
||||
printf(" - Don't automatically clear boot flag valid bit on timeout\n");
|
||||
if((rsp->data[2]&0x04) == 0x04)
|
||||
printf(" - Don't clear valid bit on reset/power cycle cause by watchdog\n");
|
||||
if((rsp->data[2]&0x02) == 0x02)
|
||||
printf(" - Don't clear valid bit on push button reset // soft reset\n");
|
||||
if((rsp->data[2]&0x01) == 0x01)
|
||||
printf(" - Don't clear valid bit on power up via power push button or wake event\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
printf( " Boot Info Acknowledge :\n");
|
||||
if((rsp->data[3]&0x1f) != 0)
|
||||
{
|
||||
if((rsp->data[3]&0x10) == 0x10)
|
||||
printf(" - OEM has handled boot info\n");
|
||||
if((rsp->data[3]&0x08) == 0x08)
|
||||
printf(" - SMS has handled boot info\n");
|
||||
if((rsp->data[3]&0x04) == 0x04)
|
||||
printf(" - OS // service partition has handled boot info\n");
|
||||
if((rsp->data[3]&0x02) == 0x02)
|
||||
printf(" - OS Loader has handled boot info\n");
|
||||
if((rsp->data[3]&0x01) == 0x01)
|
||||
printf(" - BIOS/POST has handled boot info\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
printf( " Boot Flags :\n");
|
||||
|
||||
if((rsp->data[2]&0x80) == 0x80)
|
||||
printf(" - Boot Flag Valid\n");
|
||||
else
|
||||
printf(" - Boot Flag Invalid\n");
|
||||
|
||||
if((rsp->data[2]&0x40) == 0x40)
|
||||
printf(" - Options apply to all future boots\n");
|
||||
else
|
||||
printf(" - Options apply to only next boot\n");
|
||||
|
||||
if((rsp->data[2]&0x20) == 0x20)
|
||||
printf(" - BIOS EFI boot \n");
|
||||
else
|
||||
printf(" - BIOS PC Compatible (legacy) boot \n");
|
||||
|
||||
if((rsp->data[3]&0x80) == 0x80)
|
||||
printf(" - CMOS Clear\n");
|
||||
if((rsp->data[3]&0x40) == 0x40)
|
||||
printf(" - Lock Keyboard\n");
|
||||
printf(" - Boot Device Selector : ");
|
||||
switch( ((rsp->data[3]>>2)&0x0f))
|
||||
{
|
||||
case 0: printf("No override\n"); break;
|
||||
case 1: printf("Force PXE\n"); break;
|
||||
case 2: printf("Force Boot from default Hard-Drive\n"); break;
|
||||
case 3: printf("Force Boot from default Hard-Drive, request Safe-Mode\n"); break;
|
||||
case 4: printf("Force Boot from Diagnostic Partition\n"); break;
|
||||
case 5: printf("Force Boot from CD/DVD\n"); break;
|
||||
case 6: printf("Force Boot into BIOS Setup\n"); break;
|
||||
case 15: printf("Force Boot from Floppy/primary removable media\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
if((rsp->data[3]&0x02) == 0x02)
|
||||
printf(" - Screen blank\n");
|
||||
if((rsp->data[3]&0x01) == 0x01)
|
||||
printf(" - Lock out Reset buttons\n");
|
||||
|
||||
if((rsp->data[4]&0x80) == 0x80)
|
||||
printf(" - Lock out (power off/sleep request) vi Power Button\n");
|
||||
printf(" - Console Redirection control : ");
|
||||
switch( ((rsp->data[4]>>5)&0x03))
|
||||
{
|
||||
case 0: printf("System Default\n"); break;
|
||||
case 1: printf("Request Quiet Display\n"); break;
|
||||
case 2: printf("Request Verbose Display\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
if((rsp->data[4]&0x10) == 0x10)
|
||||
printf(" - Force progress event traps\n");
|
||||
if((rsp->data[4]&0x08) == 0x08)
|
||||
printf(" - User password bypass\n");
|
||||
if((rsp->data[4]&0x04) == 0x04)
|
||||
printf(" - Lock Out Sleep Button\n");
|
||||
if((rsp->data[4]&0x02) == 0x02)
|
||||
printf(" - Lock Out Sleep Button\n");
|
||||
printf(" - BIOS verbosity : ");
|
||||
switch( ((rsp->data[4]>>0)&0x03))
|
||||
{
|
||||
case 0: printf("Console redirection occurs per BIOS configuration setting (default)\n"); break;
|
||||
case 1: printf("Suppress (skip) console redirection if enabled\n"); break;
|
||||
case 2: printf("Request console redirection be enabled\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
|
||||
if((rsp->data[5]&0x08) == 0x08)
|
||||
printf(" - BIOS Shared Mode Override\n");
|
||||
printf(" - BIOS Mux Control Override : ");
|
||||
switch( ((rsp->data[5]>>0)&0x07))
|
||||
{
|
||||
case 0: printf("BIOS uses recommended setting of the mux at the end of POST\n"); break;
|
||||
case 1: printf("Requests BIOS to force mux to BMC at conclusion of POST/start of OS boot\n"); break;
|
||||
case 2: printf("Requests BIOS to force mux to system at conclusion of POST/start of OS boot\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
unsigned long session_id;
|
||||
unsigned long timestamp;
|
||||
char time_buf[40];
|
||||
time_t out_time;
|
||||
|
||||
session_id = ((unsigned long) rsp->data[3]);
|
||||
session_id |= (((unsigned long) rsp->data[4])<<8);
|
||||
session_id |= (((unsigned long) rsp->data[5])<<16);
|
||||
session_id |= (((unsigned long) rsp->data[6])<<24);
|
||||
|
||||
timestamp = ((unsigned long) rsp->data[7]);
|
||||
timestamp |= (((unsigned long) rsp->data[8])<<8);
|
||||
timestamp |= (((unsigned long) rsp->data[9])<<16);
|
||||
timestamp |= (((unsigned long) rsp->data[10])<<24);
|
||||
|
||||
memset(time_buf, 0, 40);
|
||||
strftime(
|
||||
time_buf,
|
||||
sizeof(time_buf),
|
||||
"%m/%d/%Y %H:%M:%S", localtime(&out_time)
|
||||
);
|
||||
|
||||
printf(" Boot Initiator Info :\n");
|
||||
printf(" Channel Number : %d\n", (rsp->data[2] & 0x0f));
|
||||
printf(" Session Id : %08lXh\n",session_id);
|
||||
if(timestamp != 0)
|
||||
{
|
||||
printf(" Timestamp : %08lXh, %s\n",timestamp,time_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" Timestamp : %08lXh, undefined\n",timestamp);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
printf(" Selector : %d\n", rsp->data[2] );
|
||||
printf(" Block Data : %s\n", buf2str(rsp->data+3, rsp->data_len - 2));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf(" Undefined byte\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, int clearcmos)
|
||||
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, uint8_t *iflags)
|
||||
{
|
||||
uint8_t flags[5];
|
||||
int rc = 0;
|
||||
int use_progress = 1;
|
||||
|
||||
if (use_progress) {
|
||||
/* set set-in-progress flag */
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x01;
|
||||
rc = ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS, flags, 1);
|
||||
if (rc < 0)
|
||||
use_progress = 0;
|
||||
}
|
||||
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x01;
|
||||
flags[1] = 0x01;
|
||||
rc = ipmi_chassis_set_bootparam(intf, 4, flags, 2);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_INFO_ACK,
|
||||
flags, 2);
|
||||
|
||||
memset(flags, 0, 5);
|
||||
if (arg == NULL)
|
||||
flags[1] = 0x00;
|
||||
else if (strncmp(arg, "none", 4) == 0)
|
||||
flags[1] = 0x00;
|
||||
else if (strncmp(arg, "pxe", 3) == 0 ||
|
||||
strncmp(arg, "force_pxe", 9) == 0)
|
||||
flags[1] = 0x04;
|
||||
else if (strncmp(arg, "disk", 4) == 0 ||
|
||||
strncmp(arg, "force_disk", 10) == 0)
|
||||
flags[1] = 0x08;
|
||||
else if (strncmp(arg, "safe", 4) == 0 ||
|
||||
strncmp(arg, "force_safe", 10) == 0)
|
||||
flags[1] = 0x0c;
|
||||
else if (strncmp(arg, "diag", 4) == 0 ||
|
||||
strncmp(arg, "force_diag", 10) == 0)
|
||||
flags[1] = 0x10;
|
||||
else if (strncmp(arg, "cdrom", 5) == 0 ||
|
||||
strncmp(arg, "force_cdrom", 11) == 0)
|
||||
flags[1] = 0x14;
|
||||
else if (strncmp(arg, "floppy", 6) == 0 ||
|
||||
strncmp(arg, "force_floppy", 12) == 0)
|
||||
flags[1] = 0x3c;
|
||||
else if (strncmp(arg, "bios", 4) == 0 ||
|
||||
strncmp(arg, "force_bios", 10) == 0)
|
||||
flags[1] = 0x18;
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid argument: %s", arg);
|
||||
if (rc < 0) {
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (clearcmos)
|
||||
flags[1] |= 0x80;
|
||||
if (iflags == NULL)
|
||||
memset(flags, 0, 5);
|
||||
else
|
||||
memcpy(flags, iflags, sizeof (flags));
|
||||
|
||||
if (arg == NULL)
|
||||
flags[1] |= 0x00;
|
||||
else if (strncmp(arg, "none", 4) == 0)
|
||||
flags[1] |= 0x00;
|
||||
else if (strncmp(arg, "pxe", 3) == 0 ||
|
||||
strncmp(arg, "force_pxe", 9) == 0)
|
||||
flags[1] |= 0x04;
|
||||
else if (strncmp(arg, "disk", 4) == 0 ||
|
||||
strncmp(arg, "force_disk", 10) == 0)
|
||||
flags[1] |= 0x08;
|
||||
else if (strncmp(arg, "safe", 4) == 0 ||
|
||||
strncmp(arg, "force_safe", 10) == 0)
|
||||
flags[1] |= 0x0c;
|
||||
else if (strncmp(arg, "diag", 4) == 0 ||
|
||||
strncmp(arg, "force_diag", 10) == 0)
|
||||
flags[1] |= 0x10;
|
||||
else if (strncmp(arg, "cdrom", 5) == 0 ||
|
||||
strncmp(arg, "force_cdrom", 11) == 0)
|
||||
flags[1] |= 0x14;
|
||||
else if (strncmp(arg, "floppy", 6) == 0 ||
|
||||
strncmp(arg, "force_floppy", 12) == 0)
|
||||
flags[1] |= 0x3c;
|
||||
else if (strncmp(arg, "bios", 4) == 0 ||
|
||||
strncmp(arg, "force_bios", 10) == 0)
|
||||
flags[1] |= 0x18;
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid argument: %s", arg);
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* set flag valid bit */
|
||||
flags[0] = 0x80;
|
||||
rc = ipmi_chassis_set_bootparam(intf, 5, flags, 5);
|
||||
if (rc == 0)
|
||||
flags[0] |= 0x80;
|
||||
|
||||
rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS,
|
||||
flags, 5);
|
||||
if (rc == 0) {
|
||||
if (use_progress) {
|
||||
/* set-in-progress = commit-write */
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x02;
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
|
||||
printf("Set Boot Device to %s\n", arg);
|
||||
}
|
||||
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -577,7 +878,7 @@ ipmi_chassis_power_policy(struct ipmi_intf * intf, uint8_t policy)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Power Restore Policy command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -651,7 +952,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
int rc = 0;
|
||||
|
||||
if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, selftest");
|
||||
lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, bootparam, selftest");
|
||||
}
|
||||
else if (strncmp(argv[0], "status", 6) == 0) {
|
||||
rc = ipmi_chassis_status(intf);
|
||||
@ -752,7 +1053,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
|
||||
} else {
|
||||
if (strncmp(argv[2], "bootflag", 8) == 0)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[3], 0);
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[3], NULL);
|
||||
else
|
||||
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
|
||||
}
|
||||
@ -764,6 +1065,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
else if (strncmp(argv[0], "bootdev", 7) == 0) {
|
||||
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "bootdev <device> [clear-cmos=yes|no]");
|
||||
lprintf(LOG_NOTICE, "bootdev <device> [options=help,...]");
|
||||
lprintf(LOG_NOTICE, " none : Do not change boot device order");
|
||||
lprintf(LOG_NOTICE, " pxe : Force PXE boot");
|
||||
lprintf(LOG_NOTICE, " disk : Force boot from default Hard-drive");
|
||||
@ -771,17 +1073,110 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
lprintf(LOG_NOTICE, " diag : Force boot from Diagnostic Partition");
|
||||
lprintf(LOG_NOTICE, " cdrom : Force boot from CD/DVD");
|
||||
lprintf(LOG_NOTICE, " bios : Force boot into BIOS Setup");
|
||||
lprintf(LOG_NOTICE, " floppy: Force boot from Floppy/primary removable media");
|
||||
} else {
|
||||
if (argc < 3)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
|
||||
if (strncmp(argv[2]+11, "yes", 3) == 0)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 1);
|
||||
else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
if (strncmp(argv[2]+11, "yes", 3) == 0) {
|
||||
uint8_t flags[5] = {0, (1<<7), 0, 0, 0};
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
|
||||
} else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
}
|
||||
else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
else if (strncmp(argv[2], "options=", 8) == 0) {
|
||||
char *token;
|
||||
char *saveptr = NULL;
|
||||
int optionError = 0;
|
||||
unsigned char flags[5];
|
||||
static struct {
|
||||
char *name;
|
||||
int i;
|
||||
unsigned char mask;
|
||||
unsigned char value;
|
||||
char *desc;
|
||||
} options[] = {
|
||||
/* data 1 */
|
||||
{"valid", 0, (1<<7), (1<<7),
|
||||
"Boot flags valid"},
|
||||
{"persistent", 0, (1<<6), (1<<6),
|
||||
"Changes are persistent for all future boots"},
|
||||
{"efiboot", 0, (1<<5), (1<<5),
|
||||
"Extensible Firmware Interface Boot (EFI)"},
|
||||
/* data 2 */
|
||||
{"clear-cmos", 1, (1<<7), (1<<7),
|
||||
"CMOS clear"},
|
||||
{"lockkbd", 1, (1<<6), (1<<6),
|
||||
"Lock Keyboard"},
|
||||
/* data2[5:2] is parsed elsewhere */
|
||||
{"screenblank", 1, (1<<1), (1<<1),
|
||||
"Screen Blank"},
|
||||
{"lockoutreset", 1, (1<<0), (1<<0),
|
||||
"Lock out Resetbuttons"},
|
||||
/* data 3 */
|
||||
{"lockout_power", 2, (1<<7), (1<<7),
|
||||
"Lock out (power off/sleep request) via Power Button"},
|
||||
{"verbose=default", 2, (3<<5), (0<<5),
|
||||
"Request quiet BIOS display"},
|
||||
{"verbose=no", 2, (3<<5), (1<<5),
|
||||
"Request quiet BIOS display"},
|
||||
{"verbose=yes", 2, (3<<5), (2<<5),
|
||||
"Request verbose BIOS display"},
|
||||
{"force_pet", 2, (1<<4), (1<<4),
|
||||
"Force progress event traps"},
|
||||
{"upw_bypass", 2, (1<<3), (1<<3),
|
||||
"User password bypass"},
|
||||
{"lockout_sleep", 2, (1<<2), (1<<2),
|
||||
"Log Out Sleep Button"},
|
||||
{"cons_redirect=default", 2, (3<<0), (0<<0),
|
||||
"Console redirection occurs per BIOS configuration setting"},
|
||||
{"cons_redirect=skip", 2, (3<<0), (1<<0),
|
||||
"Suppress (skip) console redirection if enabled"},
|
||||
{"cons_redirect=enable", 2, (3<<0), (2<<0),
|
||||
"Suppress (skip) console redirection if enabled"},
|
||||
/* data 4 */
|
||||
/* data4[7:4] reserved */
|
||||
/* data4[3] BIOS Shared Mode Override, not implemented here */
|
||||
/* data4[2:0] BIOS Mux Control Override, not implemented here */
|
||||
|
||||
/* data5 reserved */
|
||||
|
||||
{NULL} /* End marker */
|
||||
}, *op;
|
||||
|
||||
memset(&flags[0], 0, sizeof(flags));
|
||||
token = strtok_r(argv[2] + 8, ",", &saveptr);
|
||||
while (token != NULL) {
|
||||
if (strcmp(token, "help") == 0) {
|
||||
optionError = 1;
|
||||
break;
|
||||
}
|
||||
for (op = options; op->name != NULL; ++op) {
|
||||
if (strcmp(token, op->name) == 0) {
|
||||
flags[op->i] &= op->mask;
|
||||
flags[op->i] |= op->value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (op->name == NULL) {
|
||||
/* Option not found */
|
||||
optionError = 1;
|
||||
lprintf(LOG_ERR, "Invalid option: %s", token);
|
||||
}
|
||||
token = strtok_r(NULL, ",", &saveptr);
|
||||
}
|
||||
if (optionError) {
|
||||
lprintf(LOG_NOTICE, "Legal options are:");
|
||||
lprintf(LOG_NOTICE, "\thelp:\tprint this message");
|
||||
for (op = options; op->name != NULL; ++op) {
|
||||
lprintf(LOG_NOTICE, "\t%s:\t%s", op->name, op->desc);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
|
||||
}
|
||||
else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
2096
ipmitool/lib/ipmi_dcmi.c
Executable file
2096
ipmitool/lib/ipmi_dcmi.c
Executable file
File diff suppressed because it is too large
Load Diff
4225
ipmitool/lib/ipmi_delloem.c
Normal file
4225
ipmitool/lib/ipmi_delloem.c
Normal file
File diff suppressed because it is too large
Load Diff
4190
ipmitool/lib/ipmi_ekanalyzer.c
Normal file
4190
ipmitool/lib/ipmi_ekanalyzer.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -57,7 +53,7 @@
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
|
||||
static int
|
||||
static void
|
||||
ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
|
||||
{
|
||||
struct sel_event_record sel_event;
|
||||
@ -75,7 +71,7 @@ ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
|
||||
sel_event.sel_type.standard_type.event_data[0] = pmsg->event_data[0];
|
||||
sel_event.sel_type.standard_type.event_data[1] = pmsg->event_data[1];
|
||||
sel_event.sel_type.standard_type.event_data[2] = pmsg->event_data[2];
|
||||
|
||||
|
||||
if (verbose)
|
||||
ipmi_sel_print_extended_entry_verbose(intf, &sel_event);
|
||||
else
|
||||
@ -101,7 +97,7 @@ ipmi_send_platform_event(struct ipmi_intf * intf, struct platform_event_msg * em
|
||||
if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
|
||||
/* system interface, need extra generator ID */
|
||||
req.msg.data_len = 8;
|
||||
rqdata[0] = 0x20;
|
||||
rqdata[0] = 0x41; // As per Fig. 29-2 and Table 5-4
|
||||
memcpy(rqdata+1, emsg, sizeof(struct platform_event_msg));
|
||||
}
|
||||
else {
|
||||
@ -231,8 +227,8 @@ ipmi_event_find_offset(uint8_t code,
|
||||
static void
|
||||
print_sensor_states(uint8_t sensor_type, uint8_t event_type)
|
||||
{
|
||||
printf("Sensor States: \n ");
|
||||
ipmi_sdr_print_discrete_state_mini("\n ", sensor_type,
|
||||
ipmi_sdr_print_discrete_state_mini(
|
||||
"Sensor States: \n ", "\n ", sensor_type,
|
||||
event_type, 0xff, 0xff);
|
||||
printf("\n");
|
||||
}
|
||||
@ -245,6 +241,7 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
|
||||
struct sdr_record_list * sdr;
|
||||
struct platform_event_msg emsg;
|
||||
int off;
|
||||
uint8_t target, lun, channel;
|
||||
|
||||
if (id == NULL) {
|
||||
lprintf(LOG_ERR, "No sensor ID supplied");
|
||||
@ -276,19 +273,15 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
|
||||
switch (sdr->type)
|
||||
{
|
||||
case SDR_RECORD_TYPE_FULL_SENSOR:
|
||||
|
||||
emsg.sensor_type = sdr->record.full->sensor.type;
|
||||
emsg.sensor_num = sdr->record.full->keys.sensor_num;
|
||||
emsg.event_type = sdr->record.full->event_type;
|
||||
break;
|
||||
|
||||
case SDR_RECORD_TYPE_COMPACT_SENSOR:
|
||||
|
||||
emsg.sensor_type = sdr->record.compact->sensor.type;
|
||||
emsg.sensor_num = sdr->record.compact->keys.sensor_num;
|
||||
emsg.event_type = sdr->record.compact->event_type;
|
||||
emsg.sensor_type = sdr->record.common->sensor.type;
|
||||
emsg.sensor_num = sdr->record.common->keys.sensor_num;
|
||||
emsg.event_type = sdr->record.common->event_type;
|
||||
target = sdr->record.common->keys.owner_id;
|
||||
lun = sdr->record.common->keys.lun;
|
||||
channel = sdr->record.common->keys.channel;
|
||||
break;
|
||||
|
||||
default:
|
||||
lprintf(LOG_ERR, "Unknown sensor type for id '%s'", id);
|
||||
return -1;
|
||||
@ -347,40 +340,48 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
|
||||
(emsg.event_dir == EVENT_DIR_DEASSERT && hilo == 1))
|
||||
emsg.event_data[0] = (uint8_t)(str2val(state, ipmi_event_thresh_lo) & 0xf);
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid Event\n");
|
||||
lprintf(LOG_ERR, "Invalid Event");
|
||||
return -1;
|
||||
}
|
||||
|
||||
rsp = ipmi_sdr_get_sensor_thresholds(intf, emsg.sensor_num);
|
||||
|
||||
if (rsp != NULL && rsp->ccode == 0) {
|
||||
|
||||
/* threshold reading */
|
||||
emsg.event_data[2] = rsp->data[(emsg.event_data[0] / 2) + 1];
|
||||
|
||||
rsp = ipmi_sdr_get_sensor_hysteresis(intf, emsg.sensor_num);
|
||||
if (rsp != NULL && rsp->ccode == 0)
|
||||
off = dir ? rsp->data[0] : rsp->data[1];
|
||||
if (off <= 0)
|
||||
off = 1;
|
||||
|
||||
/* trigger reading */
|
||||
if (dir) {
|
||||
if ((emsg.event_data[2] + off) > 0xff)
|
||||
emsg.event_data[1] = 0xff;
|
||||
else
|
||||
emsg.event_data[1] = emsg.event_data[2] + off;
|
||||
}
|
||||
else {
|
||||
if ((emsg.event_data[2] - off) < 0)
|
||||
emsg.event_data[1] = 0;
|
||||
else
|
||||
emsg.event_data[1] = emsg.event_data[2] - off;
|
||||
}
|
||||
|
||||
/* trigger in byte 2, threshold in byte 3 */
|
||||
emsg.event_data[0] |= 0x50;
|
||||
rsp = ipmi_sdr_get_sensor_thresholds(intf, emsg.sensor_num,
|
||||
target, lun, channel);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR,
|
||||
"Command Get Sensor Thresholds failed: invalid response.");
|
||||
return (-1);
|
||||
} else if (rsp->ccode != 0) {
|
||||
lprintf(LOG_ERR, "Command Get Sensor Thresholds failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* threshold reading */
|
||||
emsg.event_data[2] = rsp->data[(emsg.event_data[0] / 2) + 1];
|
||||
|
||||
rsp = ipmi_sdr_get_sensor_hysteresis(intf, emsg.sensor_num,
|
||||
target, lun, channel);
|
||||
if (rsp != NULL && rsp->ccode == 0)
|
||||
off = dir ? rsp->data[0] : rsp->data[1];
|
||||
if (off <= 0)
|
||||
off = 1;
|
||||
|
||||
/* trigger reading */
|
||||
if (dir) {
|
||||
if ((emsg.event_data[2] + off) > 0xff)
|
||||
emsg.event_data[1] = 0xff;
|
||||
else
|
||||
emsg.event_data[1] = emsg.event_data[2] + off;
|
||||
}
|
||||
else {
|
||||
if ((emsg.event_data[2] - off) < 0)
|
||||
emsg.event_data[1] = 0;
|
||||
else
|
||||
emsg.event_data[1] = emsg.event_data[2] - off;
|
||||
}
|
||||
|
||||
/* trigger in byte 2, threshold in byte 3 */
|
||||
emsg.event_data[0] |= 0x50;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -506,7 +507,7 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
chmed = ipmi_current_channel_medium(intf);
|
||||
if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
|
||||
/* system interface, need extra generator ID */
|
||||
rqdata[0] = 0x20;
|
||||
rqdata[0] = 0x41; // As per Fig. 29-2 and Table 5-4
|
||||
req.msg.data_len = 8;
|
||||
}
|
||||
|
||||
@ -527,10 +528,10 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
|
||||
/* clip off trailing and leading whitespace */
|
||||
ptr--;
|
||||
while (isspace(*ptr) && ptr >= buf)
|
||||
while (isspace((int)*ptr) && ptr >= buf)
|
||||
*ptr-- = '\0';
|
||||
ptr = buf;
|
||||
while (isspace(*ptr))
|
||||
while (isspace((int)*ptr))
|
||||
ptr++;
|
||||
if (strlen(ptr) == 0)
|
||||
continue;
|
||||
@ -601,7 +602,7 @@ ipmi_event_usage(void)
|
||||
lprintf(LOG_NOTICE, " Use the 'sel save' command to generate from SEL");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, "usage: event <sensorid> <state> [event_dir]");
|
||||
lprintf(LOG_NOTICE, " sensorid : Sensor ID to use for event data");
|
||||
lprintf(LOG_NOTICE, " sensorid : Sensor ID string to use for event data");
|
||||
lprintf(LOG_NOTICE, " state : Sensor state, use 'list' to see possible states for sensor");
|
||||
lprintf(LOG_NOTICE, " event_dir : assert, deassert [default=assert]");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
|
1191
ipmitool/lib/ipmi_firewall.c
Normal file
1191
ipmitool/lib/ipmi_firewall.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
640
ipmitool/lib/ipmi_gendev.c
Normal file
640
ipmitool/lib/ipmi_gendev.c
Normal file
@ -0,0 +1,640 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi_mc.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
#include <ipmitool/ipmi_gendev.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_sel.h>
|
||||
#include <ipmitool/ipmi_entity.h>
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/ipmi_raw.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
extern int verbose;
|
||||
|
||||
|
||||
#define GENDEV_RETRY_COUNT 5
|
||||
#define GENDEV_MAX_SIZE 16
|
||||
|
||||
typedef struct gendev_eeprom_info
|
||||
{
|
||||
uint32_t size;
|
||||
uint16_t page_size;
|
||||
uint8_t address_span;
|
||||
uint8_t address_length;
|
||||
}t_gendev_eeprom_info;
|
||||
|
||||
|
||||
static int
|
||||
ipmi_gendev_get_eeprom_size(
|
||||
struct ipmi_intf *intf,
|
||||
struct sdr_record_generic_locator *dev,
|
||||
t_gendev_eeprom_info *info
|
||||
)
|
||||
{
|
||||
int eeprom_size = 0;
|
||||
/*
|
||||
lprintf(LOG_ERR, "Gen Device : %s", dev->id_string);
|
||||
lprintf(LOG_ERR, "Access Addr: %x", dev->dev_access_addr);
|
||||
lprintf(LOG_ERR, "Slave Addr : %x", dev->dev_slave_addr);
|
||||
lprintf(LOG_ERR, "Channel Num: %x", dev->channel_num);
|
||||
lprintf(LOG_ERR, "Lun : %x", dev->lun);
|
||||
lprintf(LOG_ERR, "Bus : %x", dev->bus);
|
||||
lprintf(LOG_ERR, "Addr Span : %x", dev->addr_span);
|
||||
lprintf(LOG_ERR, "DevType : %x", dev->dev_type);
|
||||
lprintf(LOG_ERR, "DevType Mod: %x", dev->dev_type_modifier);
|
||||
*/
|
||||
if( info != NULL)
|
||||
{
|
||||
switch(dev->dev_type)
|
||||
{
|
||||
case 0x08: // 24C01
|
||||
info->size = 128;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 1;
|
||||
break;
|
||||
case 0x09: // 24C02
|
||||
info->size = 256;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 1;
|
||||
break;
|
||||
case 0x0A: // 24C04
|
||||
info->size = 512;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0B: // 24C08
|
||||
info->size = 1024;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0C: // 24C16
|
||||
info->size = 2048;
|
||||
info->page_size = 256;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0D: // 24C17
|
||||
info->size = 2048;
|
||||
info->page_size = 256;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0E: // 24C32
|
||||
info->size = 4096;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0F: // 24C64
|
||||
info->size = 8192;
|
||||
info->page_size = 32;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0xC0: // Proposed OEM Code for 24C128
|
||||
info->size = 16384;
|
||||
info->page_size = 64;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0xC1: // Proposed OEM Code for 24C256
|
||||
info->size = 32748;
|
||||
info->page_size = 64;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0xC2: // Proposed OEM Code for 24C512
|
||||
info->size = 65536;
|
||||
info->page_size = 128;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0xC3: // Proposed OEM Code for 24C1024
|
||||
info->size = 131072;
|
||||
info->page_size = 128;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
/* Please reserved up to CFh for future update */
|
||||
default: // Not a eeprom, return size = 0;
|
||||
info->size = 0;
|
||||
info->page_size = 0;
|
||||
info->address_span = 0;
|
||||
info->address_length = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
eeprom_size = info->size;
|
||||
}
|
||||
|
||||
return eeprom_size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
ipmi_gendev_read_file(
|
||||
struct ipmi_intf *intf,
|
||||
struct sdr_record_generic_locator *dev,
|
||||
const char *ofile
|
||||
)
|
||||
{
|
||||
int rc = 0;
|
||||
int eeprom_size;
|
||||
t_gendev_eeprom_info eeprom_info;
|
||||
|
||||
eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
|
||||
|
||||
if(eeprom_size > 0)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
/* now write to file */
|
||||
fp = ipmi_open_file_write(ofile);
|
||||
|
||||
if(fp)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
int numWrite;
|
||||
uint32_t counter;
|
||||
uint8_t msize;
|
||||
uint8_t channel = dev->channel_num;
|
||||
uint8_t i2cbus = dev->bus;
|
||||
uint8_t i2caddr = dev->dev_slave_addr;
|
||||
uint8_t privatebus = 1;
|
||||
uint32_t address_span_size;
|
||||
uint8_t percentCompleted = 0;
|
||||
|
||||
|
||||
/* Handle Address Span */
|
||||
if( eeprom_info.address_span != 0)
|
||||
{
|
||||
address_span_size =
|
||||
(eeprom_info.size / (eeprom_info.address_span+1));
|
||||
}
|
||||
else
|
||||
{
|
||||
address_span_size = eeprom_info.size;
|
||||
}
|
||||
|
||||
/* Setup read/write size */
|
||||
if( eeprom_info.page_size < GENDEV_MAX_SIZE)
|
||||
{
|
||||
msize = eeprom_info.page_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
msize = GENDEV_MAX_SIZE;
|
||||
// All eeprom with page higher than 32 is on the
|
||||
// 16 bytes boundary
|
||||
}
|
||||
|
||||
/* Setup i2c bus byte */
|
||||
i2cbus = ((channel & 0xF) << 4) | ((i2cbus & 7) << 1) | privatebus;
|
||||
|
||||
/*
|
||||
lprintf(LOG_ERR, "Generic device: %s", dev->id_string);
|
||||
lprintf(LOG_ERR, "I2C Chnl: %x", channel);
|
||||
lprintf(LOG_ERR, "I2C Bus : %x", i2cbus);
|
||||
lprintf(LOG_ERR, "I2C Addr: %x", i2caddr); */
|
||||
|
||||
for (
|
||||
counter = 0;
|
||||
(counter < (eeprom_info.size)) && (rc == 0);
|
||||
counter+= msize
|
||||
)
|
||||
{
|
||||
uint8_t retryCounter;
|
||||
|
||||
for(
|
||||
retryCounter = 0;
|
||||
retryCounter<GENDEV_RETRY_COUNT;
|
||||
retryCounter ++
|
||||
)
|
||||
{
|
||||
uint8_t wrByte[GENDEV_MAX_SIZE+2];
|
||||
|
||||
wrByte[0] = (uint8_t) (counter>>0);
|
||||
if(eeprom_info.address_length > 1)
|
||||
{
|
||||
wrByte[1] = (uint8_t) (counter>>8);
|
||||
}
|
||||
|
||||
i2caddr+= (((eeprom_info.size) % address_span_size) * 2);
|
||||
|
||||
rsp = ipmi_master_write_read(
|
||||
intf,
|
||||
i2cbus,
|
||||
i2caddr,
|
||||
(uint8_t *) wrByte,
|
||||
eeprom_info.address_length,
|
||||
msize
|
||||
);
|
||||
|
||||
if (rsp != NULL)
|
||||
{
|
||||
retryCounter = GENDEV_RETRY_COUNT;
|
||||
rc = 0;
|
||||
}
|
||||
else if(retryCounter < GENDEV_RETRY_COUNT)
|
||||
{
|
||||
retryCounter ++;
|
||||
lprintf(LOG_ERR, "Retry");
|
||||
sleep(1);
|
||||
rc = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if( rc == 0 )
|
||||
{
|
||||
static uint8_t previousCompleted = 101;
|
||||
numWrite = fwrite(rsp->data, 1, msize, fp);
|
||||
if (numWrite != msize)
|
||||
{
|
||||
lprintf(LOG_ERR, "Error writing file %s", ofile);
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
percentCompleted = ((counter * 100) / eeprom_info.size );
|
||||
|
||||
if(percentCompleted != previousCompleted)
|
||||
{
|
||||
printf("\r%i percent completed", percentCompleted);
|
||||
previousCompleted = percentCompleted;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if(counter == (eeprom_info.size))
|
||||
{
|
||||
printf("\r%%100 percent completed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\rError: %i percent completed, read not completed \n", percentCompleted);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "The selected generic device is not an eeprom");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_gendev_write_file - Read raw SDR from binary file
|
||||
*
|
||||
* used for writing generic locator device Eeprom type
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @dev: generic device to read
|
||||
* @ofile: output filename
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
static int
|
||||
ipmi_gendev_write_file(
|
||||
struct ipmi_intf *intf,
|
||||
struct sdr_record_generic_locator *dev,
|
||||
const char *ofile
|
||||
)
|
||||
{
|
||||
int rc = 0;
|
||||
int eeprom_size;
|
||||
t_gendev_eeprom_info eeprom_info;
|
||||
|
||||
eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
|
||||
|
||||
if(eeprom_size > 0)
|
||||
{
|
||||
FILE *fp;
|
||||
uint32_t fileLength = 0;
|
||||
|
||||
/* now write to file */
|
||||
fp = ipmi_open_file_read(ofile);
|
||||
|
||||
if(fp)
|
||||
{
|
||||
/* Retreive file length, check if it's fits the Eeprom Size */
|
||||
fseek(fp, 0 ,SEEK_END);
|
||||
fileLength = ftell(fp);
|
||||
|
||||
lprintf(LOG_ERR, "File Size: %i", fileLength);
|
||||
lprintf(LOG_ERR, "Eeprom Size: %i", eeprom_size);
|
||||
if(fileLength != eeprom_size)
|
||||
{
|
||||
lprintf(LOG_ERR, "File size does not fit Eeprom Size");
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
fseek(fp, 0 ,SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
if(fp)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
int numRead;
|
||||
uint32_t counter;
|
||||
uint8_t msize;
|
||||
uint8_t channel = dev->channel_num;
|
||||
uint8_t i2cbus = dev->bus;
|
||||
uint8_t i2caddr = dev->dev_slave_addr;
|
||||
uint8_t privatebus = 1;
|
||||
uint32_t address_span_size;
|
||||
uint8_t percentCompleted = 0;
|
||||
|
||||
|
||||
/* Handle Address Span */
|
||||
if( eeprom_info.address_span != 0)
|
||||
{
|
||||
address_span_size =
|
||||
(eeprom_info.size / (eeprom_info.address_span+1));
|
||||
}
|
||||
else
|
||||
{
|
||||
address_span_size = eeprom_info.size;
|
||||
}
|
||||
|
||||
/* Setup read/write size */
|
||||
if( eeprom_info.page_size < GENDEV_MAX_SIZE)
|
||||
{
|
||||
msize = eeprom_info.page_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
msize = GENDEV_MAX_SIZE;
|
||||
// All eeprom with page higher than 32 is on the
|
||||
// 16 bytes boundary
|
||||
}
|
||||
|
||||
/* Setup i2c bus byte */
|
||||
i2cbus = ((channel & 0xF) << 4) | ((i2cbus & 7) << 1) | privatebus;
|
||||
|
||||
/*
|
||||
lprintf(LOG_ERR, "Generic device: %s", dev->id_string);
|
||||
lprintf(LOG_ERR, "I2C Chnl: %x", channel);
|
||||
lprintf(LOG_ERR, "I2C Bus : %x", i2cbus);
|
||||
lprintf(LOG_ERR, "I2C Addr: %x", i2caddr); */
|
||||
|
||||
for (
|
||||
counter = 0;
|
||||
(counter < (eeprom_info.size)) && (rc == 0);
|
||||
counter+= msize
|
||||
)
|
||||
{
|
||||
uint8_t retryCounter;
|
||||
uint8_t readByte[GENDEV_MAX_SIZE];
|
||||
|
||||
numRead = fread(readByte, 1, msize, fp);
|
||||
if (numRead != msize)
|
||||
{
|
||||
lprintf(LOG_ERR, "Error reading file %s", ofile);
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(
|
||||
retryCounter = 0;
|
||||
retryCounter<GENDEV_RETRY_COUNT;
|
||||
retryCounter ++
|
||||
)
|
||||
{
|
||||
uint8_t wrByte[GENDEV_MAX_SIZE+2];
|
||||
wrByte[0] = (uint8_t) (counter>>0);
|
||||
if(eeprom_info.address_length > 1)
|
||||
{
|
||||
wrByte[1] = (uint8_t) (counter>>8);
|
||||
}
|
||||
memcpy(&wrByte[eeprom_info.address_length], readByte, msize);
|
||||
|
||||
i2caddr+= (((eeprom_info.size) % address_span_size) * 2);
|
||||
|
||||
rsp = ipmi_master_write_read(intf, i2cbus, i2caddr, (uint8_t *) wrByte, eeprom_info.address_length+msize, 0);
|
||||
if (rsp != NULL)
|
||||
{
|
||||
retryCounter = GENDEV_RETRY_COUNT;
|
||||
rc = 0;
|
||||
}
|
||||
else if(retryCounter < GENDEV_RETRY_COUNT)
|
||||
{
|
||||
retryCounter ++;
|
||||
lprintf(LOG_ERR, "Retry");
|
||||
sleep(1);
|
||||
rc = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if( rc == 0 )
|
||||
{
|
||||
static uint8_t previousCompleted = 101;
|
||||
percentCompleted = ((counter * 100) / eeprom_info.size );
|
||||
|
||||
if(percentCompleted != previousCompleted)
|
||||
{
|
||||
printf("\r%i percent completed", percentCompleted);
|
||||
previousCompleted = percentCompleted;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(counter == (eeprom_info.size))
|
||||
{
|
||||
printf("\r%%100 percent completed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\rError: %i percent completed, read not completed \n", percentCompleted);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "The selected generic device is not an eeprom");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_gendev_main - top-level handler for generic device
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @argc: number of arguments
|
||||
* @argv: argument list
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
int
|
||||
ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
/* initialize random numbers used later */
|
||||
srand(time(NULL));
|
||||
|
||||
lprintf(LOG_ERR, "Rx gendev command: %s", argv[0]);
|
||||
|
||||
if (
|
||||
(argc == 0)
|
||||
||
|
||||
(strncmp(argv[0], "help", 4) == 0)
|
||||
)
|
||||
{
|
||||
lprintf(LOG_ERR,
|
||||
"SDR Commands: list read write");
|
||||
lprintf(LOG_ERR,
|
||||
" list List All Generic Device Locators");
|
||||
lprintf(LOG_ERR,
|
||||
" read <sdr name> <file> Read to file eeprom specify by Generic Device Locators");
|
||||
lprintf(LOG_ERR,
|
||||
" write <sdr name> <file> Write from file eeprom specify by Generic Device Locators");
|
||||
}
|
||||
else if ( strncmp(argv[0], "list", 4) == 0)
|
||||
{
|
||||
rc = ipmi_sdr_print_sdr(intf,
|
||||
SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR);
|
||||
}
|
||||
else if (strncmp(argv[0], "read", 4) == 0)
|
||||
{
|
||||
if (argc < 3)
|
||||
lprintf(LOG_ERR, "usage: gendev read <gendev> <filename>");
|
||||
else
|
||||
{
|
||||
struct sdr_record_list *sdr;
|
||||
|
||||
lprintf(LOG_ERR, "Gendev read sdr name : %s", argv[1]);
|
||||
|
||||
printf("Locating sensor record '%s'...\n", argv[1]);
|
||||
|
||||
/* lookup by sensor name */
|
||||
sdr = ipmi_sdr_find_sdr_byid(intf, argv[1]);
|
||||
if (sdr == NULL)
|
||||
{
|
||||
lprintf(LOG_ERR, "Sensor data record not found!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
|
||||
{
|
||||
lprintf(LOG_ERR, "Target SDR is not a generic device locator");
|
||||
return -1;
|
||||
}
|
||||
|
||||
lprintf(LOG_ERR, "Gendev read file name: %s", argv[2]);
|
||||
ipmi_gendev_read_file(intf, sdr->record.genloc, argv[2]);
|
||||
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "write", 5) == 0)
|
||||
{
|
||||
if (argc < 3)
|
||||
lprintf(LOG_ERR, "usage: gendev write <gendev> <filename>");
|
||||
else
|
||||
{
|
||||
struct sdr_record_list *sdr;
|
||||
|
||||
lprintf(LOG_ERR, "Gendev write sdr name : %s", argv[1]);
|
||||
|
||||
printf("Locating sensor record '%s'...\n", argv[1]);
|
||||
|
||||
/* lookup by sensor name */
|
||||
sdr = ipmi_sdr_find_sdr_byid(intf, argv[1]);
|
||||
if (sdr == NULL)
|
||||
{
|
||||
lprintf(LOG_ERR, "Sensor data record not found!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
|
||||
{
|
||||
lprintf(LOG_ERR, "Target SDR is not a generic device locator");
|
||||
return -1;
|
||||
}
|
||||
|
||||
lprintf(LOG_ERR, "Gendev write file name: %s", argv[2]);
|
||||
ipmi_gendev_write_file(intf, sdr->record.genloc, argv[2]);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid gendev command: %s", argv[0]);
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
3979
ipmitool/lib/ipmi_hpmfwupg.c
Normal file
3979
ipmitool/lib/ipmi_hpmfwupg.c
Normal file
File diff suppressed because it is too large
Load Diff
1044
ipmitool/lib/ipmi_ime.c
Executable file
1044
ipmitool/lib/ipmi_ime.c
Executable file
File diff suppressed because it is too large
Load Diff
@ -28,15 +28,21 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/time.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include <termios.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
@ -45,39 +51,40 @@
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_isol.h>
|
||||
|
||||
const struct valstr ipmi_isol_baud_vals[] = {
|
||||
{ ISOL_BAUD_RATE_9600, "9600" },
|
||||
{ ISOL_BAUD_RATE_19200, "19200" },
|
||||
{ ISOL_BAUD_RATE_38400, "38400" },
|
||||
{ ISOL_BAUD_RATE_57600, "57600" },
|
||||
{ ISOL_BAUD_RATE_115200, "115200" },
|
||||
{ 0x00, NULL }
|
||||
};
|
||||
static struct termios _saved_tio;
|
||||
static int _in_raw_mode = 0;
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int ipmi_isol_setup(struct ipmi_intf * intf, char baudsetting)
|
||||
#define ISOL_ESCAPE_CHARACTER '~'
|
||||
|
||||
/*
|
||||
* ipmi_get_isol_info
|
||||
*/
|
||||
static int ipmi_get_isol_info(struct ipmi_intf * intf,
|
||||
struct isol_config_parameters * params)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char data[6];
|
||||
|
||||
/* TEST FOR AVAILABILITY */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_ENABLE_PARAM;
|
||||
data[2] = ISOL_ENABLE_FLAG;
|
||||
unsigned char data[6];
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_ISOL;
|
||||
req.msg.cmd = SET_ISOL_CONFIG;
|
||||
req.msg.cmd = GET_ISOL_CONFIG;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 3;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
/* GET ISOL ENABLED CONFIG */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_ENABLE_PARAM;
|
||||
data[2] = 0x00; /* block */
|
||||
data[3] = 0x00; /* selector */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config Command");
|
||||
lprintf(LOG_ERR, "Error in Get ISOL Config Command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode == 0xc1) {
|
||||
@ -85,20 +92,19 @@ static int ipmi_isol_setup(struct ipmi_intf * intf, char baudsetting)
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config Command: %s",
|
||||
lprintf(LOG_ERR, "Error in Get ISOL Config Command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
params->enabled = rsp->data[1];
|
||||
|
||||
/* GET ISOL CONFIG */
|
||||
|
||||
/* GET ISOL AUTHENTICATON CONFIG */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_AUTHENTICATION_PARAM;
|
||||
data[2] = 0x00; /* block */
|
||||
data[3] = 0x00; /* selector */
|
||||
req.msg.cmd = GET_ISOL_CONFIG;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
@ -110,86 +116,713 @@ static int ipmi_isol_setup(struct ipmi_intf * intf, char baudsetting)
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(rsp->data, rsp->data_len, "ISOL Config");
|
||||
|
||||
/* SET ISOL CONFIG - AUTHENTICATION */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_AUTHENTICATION_PARAM;
|
||||
data[2] = ISOL_PRIVILEGE_LEVEL_USER | (rsp->data[1] & 0x80);
|
||||
req.msg.cmd = SET_ISOL_CONFIG;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config (Authentication) Command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config (Authentication) Command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* SET ISOL CONFIG - BAUD RATE */
|
||||
|
||||
params->privilege_level = rsp->data[1];
|
||||
|
||||
/* GET ISOL BAUD RATE CONFIG */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_BAUD_RATE_PARAM;
|
||||
data[2] = baudsetting;
|
||||
req.msg.cmd = SET_ISOL_CONFIG;
|
||||
req.msg.data_len = 3;
|
||||
data[2] = 0x00; /* block */
|
||||
data[3] = 0x00; /* selector */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config (Baud Rate) Command");
|
||||
lprintf(LOG_ERR, "Error in Get ISOL Config Command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config (Baud Rate) Command: %s",
|
||||
lprintf(LOG_ERR, "Error in Get ISOL Config Command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Set ISOL Baud Rate to %s\n",
|
||||
val2str(baudsetting, ipmi_isol_baud_vals));
|
||||
params->bit_rate = rsp->data[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipmi_print_isol_info(struct ipmi_intf * intf)
|
||||
{
|
||||
struct isol_config_parameters params = {0};
|
||||
if (ipmi_get_isol_info(intf, ¶ms))
|
||||
return -1;
|
||||
|
||||
if (csv_output)
|
||||
{
|
||||
printf("%s,", (params.enabled & 0x1)?"true": "false");
|
||||
printf("%s,",
|
||||
val2str((params.privilege_level & 0xf), ipmi_privlvl_vals));
|
||||
printf("%s,",
|
||||
val2str((params.bit_rate & 0xf), ipmi_bit_rate_vals));
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Enabled : %s\n",
|
||||
(params.enabled & 0x1)?"true": "false");
|
||||
printf("Privilege Level : %s\n",
|
||||
val2str((params.privilege_level & 0xf), ipmi_privlvl_vals));
|
||||
printf("Bit Rate (kbps) : %s\n",
|
||||
val2str((params.bit_rate & 0xf), ipmi_bit_rate_vals));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipmi_isol_set_param(struct ipmi_intf * intf,
|
||||
const char *param,
|
||||
const char *value)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char data[6];
|
||||
struct isol_config_parameters params = {0};
|
||||
|
||||
/* We need other values to complete the request */
|
||||
if (ipmi_get_isol_info(intf, ¶ms))
|
||||
return -1;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_ISOL;
|
||||
req.msg.cmd = SET_ISOL_CONFIG;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
memset(data, 0, 6);
|
||||
|
||||
/*
|
||||
* enabled
|
||||
*/
|
||||
if (strcmp(param, "enabled") == 0)
|
||||
{
|
||||
data[1] = ISOL_ENABLE_PARAM;
|
||||
if (strcmp(value, "true") == 0)
|
||||
data[2] = 0x01;
|
||||
else if (strcmp(value, "false") == 0)
|
||||
data[2] = 0x00;
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid value %s for parameter %s",
|
||||
value, param);
|
||||
lprintf(LOG_ERR, "Valid values are true and false");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* privilege-level
|
||||
*/
|
||||
else if (strcmp(param, "privilege-level") == 0)
|
||||
{
|
||||
data[1] = ISOL_AUTHENTICATION_PARAM;
|
||||
if (! strcmp(value, "user"))
|
||||
data[2] = 0x02;
|
||||
else if (! strcmp(value, "operator"))
|
||||
data[2] = 0x03;
|
||||
else if (! strcmp(value, "admin"))
|
||||
data[2] = 0x04;
|
||||
else if (! strcmp(value, "oem"))
|
||||
data[2] = 0x05;
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid value %s for parameter %s",
|
||||
value, param);
|
||||
lprintf(LOG_ERR, "Valid values are user, operator, admin, and oem");
|
||||
return -1;
|
||||
}
|
||||
/* We need to mask bit7 from the fetched value */
|
||||
data[2] |= (params.privilege_level & 0x80) ? 0x80 : 0x00;
|
||||
}
|
||||
|
||||
/*
|
||||
* bit-rate
|
||||
*/
|
||||
else if (strcmp(param, "bit-rate") == 0)
|
||||
{
|
||||
data[1] = ISOL_BAUD_RATE_PARAM;
|
||||
if (strncmp(value, "9.6", 3) == 0) {
|
||||
data[2] = 0x06;
|
||||
}
|
||||
else if (strncmp(value, "19.2", 4) == 0) {
|
||||
data[2] = 0x07;
|
||||
}
|
||||
else if (strncmp(value, "38.4", 4) == 0) {
|
||||
data[2] = 0x08;
|
||||
}
|
||||
else if (strncmp(value, "57.6", 4) == 0) {
|
||||
data[2] = 0x09;
|
||||
}
|
||||
else if (strncmp(value, "115.2", 5) == 0) {
|
||||
data[2] = 0x0A;
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "ISOL - Unsupported baud rate: %s", value);
|
||||
lprintf(LOG_ERR, "Valid values are 9.6, 19.2, 38.4, 57.6 and 115.2");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Error: invalid ISOL parameter %s", param);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Execute the request
|
||||
*/
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error setting ISOL parameter '%s'", param);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error setting ISOL parameter '%s': %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
leave_raw_mode(void)
|
||||
{
|
||||
if (!_in_raw_mode)
|
||||
return;
|
||||
if (tcsetattr(fileno(stdin), TCSADRAIN, &_saved_tio) == -1)
|
||||
perror("tcsetattr");
|
||||
else
|
||||
_in_raw_mode = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
enter_raw_mode(void)
|
||||
{
|
||||
struct termios tio;
|
||||
if (tcgetattr(fileno(stdin), &tio) == -1) {
|
||||
perror("tcgetattr");
|
||||
return;
|
||||
}
|
||||
_saved_tio = tio;
|
||||
tio.c_iflag |= IGNPAR;
|
||||
tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF)\
|
||||
;
|
||||
tio.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
|
||||
// #ifdef IEXTEN
|
||||
tio.c_lflag &= ~IEXTEN;
|
||||
// #endif
|
||||
tio.c_oflag &= ~OPOST;
|
||||
tio.c_cc[VMIN] = 1;
|
||||
tio.c_cc[VTIME] = 0;
|
||||
if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) == -1)
|
||||
perror("tcsetattr");
|
||||
else
|
||||
_in_raw_mode = 1;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
sendBreak(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_v2_payload v2_payload;
|
||||
|
||||
memset(&v2_payload, 0, sizeof(v2_payload));
|
||||
|
||||
v2_payload.payload.sol_packet.character_count = 0;
|
||||
v2_payload.payload.sol_packet.generate_break = 1;
|
||||
|
||||
intf->send_sol(intf, &v2_payload);
|
||||
}
|
||||
|
||||
/*
|
||||
* suspendSelf
|
||||
*
|
||||
* Put ourself in the background
|
||||
*
|
||||
* param bRestoreTty specifies whether we will put our self back
|
||||
* in raw mode when we resume
|
||||
*/
|
||||
static void
|
||||
suspendSelf(int bRestoreTty)
|
||||
{
|
||||
leave_raw_mode();
|
||||
kill(getpid(), SIGTSTP);
|
||||
|
||||
if (bRestoreTty)
|
||||
enter_raw_mode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* printiSolEscapeSequences
|
||||
*
|
||||
* Send some useful documentation to the user
|
||||
*/
|
||||
static void
|
||||
printiSolEscapeSequences(void)
|
||||
{
|
||||
printf(
|
||||
"%c?\n\
|
||||
Supported escape sequences:\n\
|
||||
%c. - terminate connection\n\
|
||||
%c^Z - suspend ipmitool\n\
|
||||
%c^X - suspend ipmitool, but don't restore tty on restart\n\
|
||||
%cB - send break\n\
|
||||
%c? - this message\n\
|
||||
%c%c - send the escape character by typing it twice\n\
|
||||
(Note that escapes are only recognized immediately after newline.)\n",
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* output
|
||||
*
|
||||
* Send the specified data to stdout
|
||||
*/
|
||||
static void
|
||||
output(struct ipmi_rs * rsp)
|
||||
{
|
||||
if (rsp)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < rsp->data_len; ++i)
|
||||
putc(rsp->data[i], stdout);
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_isol_deactivate
|
||||
*/
|
||||
static int
|
||||
ipmi_isol_deactivate(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t data[6];
|
||||
struct isol_config_parameters params;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_ISOL;
|
||||
req.msg.cmd = ACTIVATE_ISOL;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 5;
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00; /* Deactivate */
|
||||
data[1] = 0x00;
|
||||
data[2] = 0x00;
|
||||
data[3] = 0x00;
|
||||
data[5] = 0x00;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error deactivating ISOL");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error deactivating ISOL: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
/* response contain 4 additional bytes : 80 00 32 ff
|
||||
Don't know what to use them for yet... */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* processiSolUserInput
|
||||
*
|
||||
* Act on user input into the ISOL session. The only reason this
|
||||
* is complicated is that we have to process escape sequences.
|
||||
*
|
||||
* return 0 on success
|
||||
* 1 if we should exit
|
||||
* < 0 on error (BMC probably closed the session)
|
||||
*/
|
||||
static int
|
||||
processiSolUserInput(struct ipmi_intf * intf,
|
||||
uint8_t * input,
|
||||
uint16_t buffer_length)
|
||||
{
|
||||
static int escape_pending = 0;
|
||||
static int last_was_cr = 1;
|
||||
struct ipmi_v2_payload v2_payload;
|
||||
int length = 0;
|
||||
int retval = 0;
|
||||
char ch;
|
||||
int i;
|
||||
|
||||
memset(&v2_payload, 0, sizeof(v2_payload));
|
||||
|
||||
/*
|
||||
* Our first order of business is to check the input for escape
|
||||
* sequences to act on.
|
||||
*/
|
||||
for (i = 0; i < buffer_length; ++i)
|
||||
{
|
||||
ch = input[i];
|
||||
|
||||
if (escape_pending){
|
||||
escape_pending = 0;
|
||||
|
||||
/*
|
||||
* Process a possible escape sequence.
|
||||
*/
|
||||
switch (ch) {
|
||||
case '.':
|
||||
printf("%c. [terminated ipmitool]\n", ISOL_ESCAPE_CHARACTER);
|
||||
retval = 1;
|
||||
break;
|
||||
case 'Z' - 64:
|
||||
printf("%c^Z [suspend ipmitool]\n", ISOL_ESCAPE_CHARACTER);
|
||||
suspendSelf(1); /* Restore tty back to raw */
|
||||
continue;
|
||||
|
||||
case 'X' - 64:
|
||||
printf("%c^X [suspend ipmitool]\n", ISOL_ESCAPE_CHARACTER);
|
||||
suspendSelf(0); /* Don't restore to raw mode */
|
||||
continue;
|
||||
|
||||
case 'B':
|
||||
printf("%cb [send break]\n", ISOL_ESCAPE_CHARACTER);
|
||||
sendBreak(intf);
|
||||
continue;
|
||||
|
||||
case '?':
|
||||
printiSolEscapeSequences();
|
||||
continue;
|
||||
default:
|
||||
if (ch != ISOL_ESCAPE_CHARACTER)
|
||||
v2_payload.payload.sol_packet.data[length++] =
|
||||
ISOL_ESCAPE_CHARACTER;
|
||||
v2_payload.payload.sol_packet.data[length++] = ch;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (last_was_cr && (ch == ISOL_ESCAPE_CHARACTER)) {
|
||||
escape_pending = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
v2_payload.payload.sol_packet.data[length++] = ch;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Normal character. Record whether it was a newline.
|
||||
*/
|
||||
last_was_cr = (ch == '\r' || ch == '\n');
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is anything left to process we dispatch it to the BMC,
|
||||
* send intf->session->sol_data.max_outbound_payload_size bytes
|
||||
* at a time.
|
||||
*/
|
||||
if (length)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
|
||||
v2_payload.payload.sol_packet.flush_outbound = 1; /* Not sure if necessary ? */
|
||||
v2_payload.payload.sol_packet.character_count = length;
|
||||
rsp = intf->send_sol(intf, &v2_payload);
|
||||
|
||||
if (! rsp) {
|
||||
lprintf(LOG_ERR, "Error sending SOL data");
|
||||
retval = -1;
|
||||
}
|
||||
|
||||
/* If the sequence number is set we know we have new data */
|
||||
else if ((rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL) &&
|
||||
(rsp->payload.sol_packet.packet_sequence_number))
|
||||
output(rsp);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_isol_red_pill
|
||||
*/
|
||||
static int
|
||||
ipmi_isol_red_pill(struct ipmi_intf * intf)
|
||||
{
|
||||
char * buffer;
|
||||
int numRead;
|
||||
int bShouldExit = 0;
|
||||
int bBmcClosedSession = 0;
|
||||
fd_set read_fds;
|
||||
struct timeval tv;
|
||||
int retval;
|
||||
int buffer_size = 255;
|
||||
int timedout = 0;
|
||||
|
||||
buffer = (char*)malloc(buffer_size);
|
||||
if (buffer == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
return -1;
|
||||
}
|
||||
|
||||
enter_raw_mode();
|
||||
|
||||
while (! bShouldExit)
|
||||
{
|
||||
FD_ZERO(&read_fds);
|
||||
FD_SET(0, &read_fds);
|
||||
FD_SET(intf->fd, &read_fds);
|
||||
|
||||
/* Wait up to half a second */
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 500000;
|
||||
|
||||
retval = select(intf->fd + 1, &read_fds, NULL, NULL, &tv);
|
||||
|
||||
if (retval)
|
||||
{
|
||||
if (retval == -1)
|
||||
{
|
||||
/* ERROR */
|
||||
perror("select");
|
||||
return -1;
|
||||
}
|
||||
|
||||
timedout = 0;
|
||||
|
||||
/*
|
||||
* Process input from the user
|
||||
*/
|
||||
if (FD_ISSET(0, &read_fds))
|
||||
{
|
||||
memset(buffer, 0, buffer_size);
|
||||
numRead = read(fileno(stdin),
|
||||
buffer,
|
||||
buffer_size);
|
||||
|
||||
if (numRead > 0)
|
||||
{
|
||||
int rc = processiSolUserInput(intf, buffer, numRead);
|
||||
|
||||
if (rc)
|
||||
{
|
||||
if (rc < 0)
|
||||
bShouldExit = bBmcClosedSession = 1;
|
||||
else
|
||||
bShouldExit = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bShouldExit = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process input from the BMC
|
||||
*/
|
||||
else if (FD_ISSET(intf->fd, &read_fds))
|
||||
{
|
||||
struct ipmi_rs * rs = intf->recv_sol(intf);
|
||||
if (! rs)
|
||||
{
|
||||
bShouldExit = bBmcClosedSession = 1;
|
||||
}
|
||||
else
|
||||
output(rs);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ERROR in select
|
||||
*/
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Error: Select returned with nothing to read");
|
||||
bShouldExit = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((++timedout) == 20) /* Every 10 seconds we send a keepalive */
|
||||
{
|
||||
intf->keepalive(intf);
|
||||
timedout = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
leave_raw_mode();
|
||||
|
||||
if (bBmcClosedSession)
|
||||
{
|
||||
lprintf(LOG_ERR, "SOL session closed by BMC");
|
||||
}
|
||||
else
|
||||
ipmi_isol_deactivate(intf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_isol_activate
|
||||
*/
|
||||
static int
|
||||
ipmi_isol_activate(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t data[6];
|
||||
struct isol_config_parameters params;
|
||||
|
||||
if (ipmi_get_isol_info(intf, ¶ms))
|
||||
return -1;
|
||||
|
||||
if (!(params.enabled & 0x1)) {
|
||||
lprintf(LOG_ERR, "ISOL is not enabled!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup a callback so that the lanplus processing knows what
|
||||
* to do with packets that come unexpectedly (while waiting for
|
||||
* an ACK, perhaps.
|
||||
*/
|
||||
intf->session->sol_data.sol_input_handler = output;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_ISOL;
|
||||
req.msg.cmd = ACTIVATE_ISOL;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 5;
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x01;
|
||||
data[1] = 0x00;
|
||||
data[2] = 0x00;
|
||||
data[3] = 0x00;
|
||||
data[5] = 0x00;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (NULL != rsp) {
|
||||
switch (rsp->ccode) {
|
||||
case 0x00:
|
||||
if (rsp->data_len == 4) {
|
||||
break;
|
||||
} else {
|
||||
lprintf(LOG_ERR, "Error: Unexpected data length (%d) received "
|
||||
"in ISOL activation response",
|
||||
rsp->data_len);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case 0x80:
|
||||
lprintf(LOG_ERR, "Info: ISOL already active on another session");
|
||||
return -1;
|
||||
case 0x81:
|
||||
lprintf(LOG_ERR, "Info: ISOL disabled");
|
||||
return -1;
|
||||
case 0x82:
|
||||
lprintf(LOG_ERR, "Info: ISOL activation limit reached");
|
||||
return -1;
|
||||
default:
|
||||
lprintf(LOG_ERR, "Error activating ISOL: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
lprintf(LOG_ERR, "Error: No response activating ISOL");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* response contain 4 additional bytes : 80 01 32 ff
|
||||
Don't know what to use them for yet... */
|
||||
|
||||
printf("[SOL Session operational. Use %c? for help]\n",
|
||||
ISOL_ESCAPE_CHARACTER);
|
||||
|
||||
/*
|
||||
* At this point we are good to go with our SOL session. We
|
||||
* need to listen to
|
||||
* 1) STDIN for user input
|
||||
* 2) The FD for incoming SOL packets
|
||||
*/
|
||||
if (ipmi_isol_red_pill(intf)) {
|
||||
lprintf(LOG_ERR, "Error in SOL session");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void print_isol_set_usage(void) {
|
||||
lprintf(LOG_NOTICE, "\nISOL set parameters and values: \n");
|
||||
lprintf(LOG_NOTICE, " enabled true | false");
|
||||
lprintf(LOG_NOTICE, " privilege-level user | operator | admin | oem");
|
||||
lprintf(LOG_NOTICE, " bit-rate "
|
||||
"9.6 | 19.2 | 38.4 | 57.6 | 115.2");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
}
|
||||
|
||||
static void print_isol_usage(void) {
|
||||
lprintf(LOG_NOTICE, "ISOL Commands: info");
|
||||
lprintf(LOG_NOTICE, " set <parameter> <setting>");
|
||||
lprintf(LOG_NOTICE, " activate");
|
||||
}
|
||||
|
||||
int ipmi_isol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "ISOL Commands: setup <baud>");
|
||||
lprintf(LOG_NOTICE, "ISOL Baud Rates: 9600, 19200, 38400, 57600, 115200");
|
||||
return 0;
|
||||
/*
|
||||
* Help
|
||||
*/
|
||||
if (!argc || !strncmp(argv[0], "help", 4))
|
||||
print_isol_usage();
|
||||
|
||||
/*
|
||||
* Info
|
||||
*/
|
||||
else if (!strncmp(argv[0], "info", 4)) {
|
||||
ret = ipmi_print_isol_info(intf);
|
||||
}
|
||||
|
||||
if (strncmp(argv[0], "setup", 5) == 0) {
|
||||
if (strncmp(argv[1], "9600", 4) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_9600);
|
||||
}
|
||||
else if (strncmp(argv[1], "19200", 5) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_19200);
|
||||
}
|
||||
else if (strncmp(argv[1], "38400", 5) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_38400);
|
||||
}
|
||||
else if (strncmp(argv[1], "57600", 5) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_57600);
|
||||
}
|
||||
else if (strncmp(argv[1], "115200", 6) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_115200);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "ISOL - Unsupported baud rate: %s", argv[1]);
|
||||
ret = -1;
|
||||
|
||||
/*
|
||||
* Set a parameter value
|
||||
*/
|
||||
else if (!strncmp(argv[0], "set", 3)) {
|
||||
if (argc < 3) {
|
||||
print_isol_set_usage();
|
||||
return -1;
|
||||
}
|
||||
ret = ipmi_isol_set_param(intf, argv[1], argv[2]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Activate
|
||||
*/
|
||||
else if (!strncmp(argv[0], "activate", 8)) {
|
||||
ret = ipmi_isol_activate(intf);
|
||||
}
|
||||
|
||||
else {
|
||||
print_isol_usage();
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
806
ipmitool/lib/ipmi_kontronoem.c
Normal file
806
ipmitool/lib/ipmi_kontronoem.c
Normal file
@ -0,0 +1,806 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tue Mar 7 14:36:12 2006
|
||||
* <stephane.filion@ca.kontron.com>
|
||||
*
|
||||
* This code implements an Kontron OEM proprietary commands.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
|
||||
|
||||
extern int verbose;
|
||||
extern int read_fru_area(struct ipmi_intf * intf, struct fru_info *fru,
|
||||
uint8_t id, uint32_t offset, uint32_t length,
|
||||
uint8_t *frubuf);
|
||||
extern int write_fru_area(struct ipmi_intf * intf, struct fru_info *fru,
|
||||
unsigned char id, unsigned int soffset,
|
||||
unsigned int doffset, unsigned int length,
|
||||
unsigned char *pFrubuf);
|
||||
|
||||
extern char * get_fru_area_str(uint8_t * data, uint32_t * offset);
|
||||
|
||||
|
||||
|
||||
static void ipmi_kontron_help(void);
|
||||
static int ipmi_kontron_set_serial_number(struct ipmi_intf * intf);
|
||||
static int ipmi_kontron_set_mfg_date (struct ipmi_intf * intf);
|
||||
|
||||
static void ipmi_kontron_nextboot_help(void);
|
||||
static int ipmi_kontron_nextboot_set(struct ipmi_intf * intf,
|
||||
int argc, char **argv);
|
||||
|
||||
static int ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf * intf,
|
||||
unsigned char channel,
|
||||
unsigned char size);
|
||||
|
||||
int
|
||||
ipmi_kontronoem_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (argc == 0)
|
||||
ipmi_kontron_help();
|
||||
else if (strncmp(argv[0], "help", 4) == 0)
|
||||
ipmi_kontron_help();
|
||||
|
||||
else if (!strncmp(argv[0], "setsn", 5))
|
||||
{
|
||||
if(argc >= 1)
|
||||
{
|
||||
if(ipmi_kontron_set_serial_number(intf) > 0)
|
||||
{
|
||||
printf("FRU serial number setted successfully\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("FRU serial number set failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("fru setsn\n");
|
||||
}
|
||||
}
|
||||
else if (!strncmp(argv[0], "setmfgdate", 5))
|
||||
{
|
||||
if(argc >= 1)
|
||||
{
|
||||
if(ipmi_kontron_set_mfg_date(intf) > 0)
|
||||
{
|
||||
printf("FRU manufacturing date setted successfully\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("FRU manufacturing date set failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("fru setmfgdate\n");
|
||||
}
|
||||
}
|
||||
else if (!strncmp(argv[0], "nextboot", sizeof("nextboot")-1))
|
||||
{
|
||||
if (argc > 1)
|
||||
{
|
||||
if ((rc = ipmi_kontron_nextboot_set(intf, argc-1, argv+1)) == 0)
|
||||
{
|
||||
printf("Nextboot set successfully\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Nextboot set failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ipmi_kontron_nextboot_help();
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
printf("Invalid Kontron command: %s", argv[0]);
|
||||
ipmi_kontron_help();
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
static void ipmi_kontron_help(void)
|
||||
{
|
||||
printf("Kontron Commands: setsn setmfgdate nextboot\n");
|
||||
}
|
||||
|
||||
|
||||
int ipmi_kontronoem_set_large_buffer(struct ipmi_intf * intf, unsigned char size)
|
||||
{
|
||||
uint8_t error_occurs = 0;
|
||||
uint32_t prev_target_addr = intf->target_addr ;
|
||||
|
||||
if ( intf->target_addr > 0 && (intf->target_addr != intf->my_addr) )
|
||||
{
|
||||
intf->target_addr = intf->my_addr;
|
||||
|
||||
printf("Set local big buffer\n");
|
||||
if(ipmi_kontronoem_send_set_large_buffer( intf, 0x0e, size ) == 0)
|
||||
{
|
||||
printf("Set local big buffer:success\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
error_occurs = 1;
|
||||
}
|
||||
|
||||
if (error_occurs == 0)
|
||||
{
|
||||
if(ipmi_kontronoem_send_set_large_buffer( intf, 0x00, size ) == 0)
|
||||
{
|
||||
printf("IPMB was set\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Revert back the previous set large buffer */
|
||||
error_occurs = 1;
|
||||
ipmi_kontronoem_send_set_large_buffer( intf, 0x0e, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore target address */
|
||||
intf->target_addr = prev_target_addr;
|
||||
}
|
||||
|
||||
if (error_occurs == 0)
|
||||
{
|
||||
if(ipmi_kontronoem_send_set_large_buffer( intf, 0x0e, size ) == 0)
|
||||
{
|
||||
//printf("Set remote big buffer\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( intf->target_addr > 0 && (intf->target_addr != intf->my_addr) )
|
||||
{
|
||||
/* Error occurs revert back the previous set large buffer*/
|
||||
intf->target_addr = intf->my_addr;
|
||||
|
||||
//ipmi_kontronoem_send_set_large_buffer( intf, 0x00, 0 );
|
||||
ipmi_kontronoem_send_set_large_buffer( intf, 0x0e, 0 );
|
||||
|
||||
intf->target_addr = prev_target_addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return error_occurs;
|
||||
}
|
||||
|
||||
|
||||
int ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf * intf, unsigned char channel,unsigned char size)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
int i;
|
||||
|
||||
memset(msg_data, 0, sizeof(msg_data));
|
||||
msg_data[0] = channel/*0x0e*/; // Currently running interface
|
||||
msg_data[1] = size;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E; /* OEM NetFn */
|
||||
req.msg.cmd = 0x82; /* Set Channel Buffer Length - OEM */
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
req.msg.lun = 0x00;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf("Cannot send large buffer command\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf("Invalid length for the selected interface (%s) %d\n",
|
||||
val2str(rsp->ccode, completion_code_vals), rsp->ccode);
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_fru_set_serial_number - Set the Serial Number in FRU
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @id: fru id
|
||||
*
|
||||
* returns -1 on error
|
||||
* returns 1 if successful
|
||||
*/
|
||||
static int
|
||||
ipmi_kontron_set_serial_number(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
struct fru_header header;
|
||||
uint8_t msg_data[4];
|
||||
char *sn;
|
||||
uint8_t sn_size, checksum;
|
||||
uint8_t *fru_data;
|
||||
char *fru_area;
|
||||
uint32_t fru_data_offset, fru_data_offset_tmp, board_sec_len, prod_sec_len, i;
|
||||
|
||||
sn = NULL;
|
||||
fru_data = NULL;
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0xb4;
|
||||
msg_data[1] = 0x90;
|
||||
msg_data[2] = 0x91;
|
||||
msg_data[3] = 0x8b;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E;
|
||||
req.msg.cmd = 0x0C;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
|
||||
/* Set Lun, necessary for this oem command */
|
||||
req.msg.lun = 0x03;
|
||||
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
return -11;
|
||||
}
|
||||
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" This option is not implemented for this board\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
sn_size = rsp->data_len;
|
||||
|
||||
sn = malloc(sn_size + 1);
|
||||
|
||||
if(sn == NULL)
|
||||
{
|
||||
printf("Out of memory!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(sn, 0, sn_size + 1);
|
||||
memcpy(sn, rsp->data, sn_size);
|
||||
|
||||
if(verbose >= 1)
|
||||
{
|
||||
printf("Original serial number is : [%s]\n", sn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
printf(" Device not present (No Response)\n");
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
fru.size = (rsp->data[1] << 8) | rsp->data[0];
|
||||
fru.access = rsp->data[2] & 0x1;
|
||||
|
||||
if (fru.size < 1) {
|
||||
printf(" Invalid FRU size %d", fru.size);
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* retrieve the FRU header
|
||||
*/
|
||||
msg_data[0] = 0;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 8;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_DATA;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(rsp->data, rsp->data_len, "FRU DATA");
|
||||
|
||||
memcpy(&header, rsp->data + 1, 8);
|
||||
|
||||
if (header.version != 1)
|
||||
{
|
||||
printf(" Unknown FRU header version 0x%02x",
|
||||
header.version);
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Set the Board Section */
|
||||
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
|
||||
|
||||
|
||||
fru_data = malloc( fru.size);
|
||||
|
||||
if(fru_data == NULL)
|
||||
{
|
||||
printf("Out of memory!");
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(fru_data, 0, fru.size);
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.board * 8) ,board_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*Position at Board Manufacturer*/
|
||||
fru_data_offset = (header.offset.board * 8) + 6;
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Board Product Name*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
fru_data_offset_tmp = fru_data_offset;
|
||||
|
||||
/*Position at Serial Number*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
|
||||
|
||||
fru_data_offset ++;
|
||||
|
||||
if(strlen(fru_area) != sn_size)
|
||||
{
|
||||
printf("The length of the serial number in the FRU Board Area is wrong.\n");
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Copy the new serial number in the board section saved in memory*/
|
||||
memcpy(fru_data + fru_data_offset, sn, sn_size);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.board * 8); i < (((header.offset.board * 8)+board_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
|
||||
fru_data[(header.offset.board * 8)+board_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.board * 8), (header.offset.board * 8), board_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Set the Product Section */
|
||||
prod_sec_len = (header.offset.multi * 8) - (header.offset.product * 8);
|
||||
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.product * 8) ,prod_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*Position at Product Manufacturer*/
|
||||
fru_data_offset = (header.offset.product * 8) + 3;
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Name*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Part*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Version*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
|
||||
|
||||
fru_data_offset_tmp = fru_data_offset;
|
||||
|
||||
/*Position at Serial Number*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
|
||||
|
||||
fru_data_offset ++;
|
||||
|
||||
if(strlen(fru_area) != sn_size)
|
||||
{
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
printf("The length of the serial number in the FRU Product Area is wrong.\n");
|
||||
return(-1);
|
||||
|
||||
}
|
||||
|
||||
/* Copy the new serial number in the product section saved in memory*/
|
||||
memcpy(fru_data + fru_data_offset, sn, sn_size);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.product * 8); i < (((header.offset.product * 8)+prod_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
|
||||
fru_data[(header.offset.product * 8)+prod_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.product * 8), (header.offset.product * 8), prod_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
|
||||
return(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_fru_set_mfg_date - Set the Manufacturing Date in FRU
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @id: fru id
|
||||
*
|
||||
* returns -1 on error
|
||||
* returns 1 if successful
|
||||
*/
|
||||
static int
|
||||
ipmi_kontron_set_mfg_date (struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
struct fru_header header;
|
||||
uint8_t msg_data[4];
|
||||
uint8_t mfg_date[3];
|
||||
|
||||
uint32_t board_sec_len, i;
|
||||
uint8_t *fru_data, checksum;
|
||||
|
||||
|
||||
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0xb4;
|
||||
msg_data[1] = 0x90;
|
||||
msg_data[2] = 0x91;
|
||||
msg_data[3] = 0x8b;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E;
|
||||
req.msg.cmd = 0x0E;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
/* Set Lun temporary, necessary for this oem command */
|
||||
req.msg.lun = 0x03;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf("Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf("This option is not implemented for this board\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if(rsp->data_len != 3)
|
||||
{
|
||||
printf("Invalid response for the Manufacturing date\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(mfg_date, 0, 3);
|
||||
memcpy(mfg_date, rsp->data, 3);
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
printf(" Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return(-1);
|
||||
}
|
||||
|
||||
fru.size = (rsp->data[1] << 8) | rsp->data[0];
|
||||
fru.access = rsp->data[2] & 0x1;
|
||||
|
||||
if (fru.size < 1) {
|
||||
printf(" Invalid FRU size %d", fru.size);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* retrieve the FRU header
|
||||
*/
|
||||
msg_data[0] = 0;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 8;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_DATA;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(rsp->data, rsp->data_len, "FRU DATA");
|
||||
|
||||
memcpy(&header, rsp->data + 1, 8);
|
||||
|
||||
if (header.version != 1)
|
||||
{
|
||||
printf(" Unknown FRU header version 0x%02x",
|
||||
header.version);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
|
||||
|
||||
fru_data = malloc( fru.size);
|
||||
|
||||
if(fru_data == NULL)
|
||||
{
|
||||
printf("Out of memory!");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(fru_data, 0, fru.size);
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.board * 8) ,board_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Copy the new manufacturing date in the board section saved in memory*/
|
||||
memcpy(fru_data + (header.offset.board * 8) + 3, mfg_date, 3);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.board * 8); i < (((header.offset.board * 8)+board_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
fru_data[(header.offset.board * 8)+board_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.board * 8), (header.offset.board * 8), board_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
static char *bootdev[] = {"BIOS", "FDD", "HDD", "CDROM", "network", 0};
|
||||
|
||||
static void
|
||||
ipmi_kontron_nextboot_help(void)
|
||||
{
|
||||
int i;
|
||||
printf("nextboot <device>\n"
|
||||
"Supported devices:\n");
|
||||
for (i = 0; bootdev[i] != 0; i++) {
|
||||
printf("- %s\n", bootdev[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* ipmi_kontron_next_boot_set - Select the next boot order on CP6012
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @id: fru id
|
||||
*
|
||||
* returns -1 on error
|
||||
* returns 1 if successful
|
||||
*/
|
||||
static int
|
||||
ipmi_kontron_nextboot_set(struct ipmi_intf * intf, int argc, char **argv)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[8];
|
||||
int i;
|
||||
|
||||
memset(msg_data, 0, sizeof(msg_data));
|
||||
msg_data[0] = 0xb4;
|
||||
msg_data[1] = 0x90;
|
||||
msg_data[2] = 0x91;
|
||||
msg_data[3] = 0x8b;
|
||||
msg_data[4] = 0x9d;
|
||||
msg_data[5] = 0xFF;
|
||||
msg_data[6] = 0xFF; /* any */
|
||||
|
||||
for (i = 0; bootdev[i] != 0; i++) {
|
||||
if (strcmp(argv[0], bootdev[i]) == 0) {
|
||||
msg_data[5] = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Invalid device selected? */
|
||||
if (msg_data[5] == 0xFF) {
|
||||
printf("Unknown boot device: %s\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E;
|
||||
req.msg.cmd = 0x02;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 7;
|
||||
|
||||
/* Set Lun temporary, necessary for this oem command */
|
||||
req.msg.lun = 0x03;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf("Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf("Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -53,6 +49,7 @@
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_session.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
#include <ipmitool/ipmi_gendev.h>
|
||||
#include <ipmitool/ipmi_sel.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
#include <ipmitool/ipmi_sol.h>
|
||||
@ -60,6 +57,7 @@
|
||||
#include <ipmitool/ipmi_lanp.h>
|
||||
#include <ipmitool/ipmi_chassis.h>
|
||||
#include <ipmitool/ipmi_mc.h>
|
||||
#include <ipmitool/ipmi_firewall.h>
|
||||
#include <ipmitool/ipmi_sensor.h>
|
||||
#include <ipmitool/ipmi_channel.h>
|
||||
#include <ipmitool/ipmi_session.h>
|
||||
@ -68,15 +66,17 @@
|
||||
#include <ipmitool/ipmi_raw.h>
|
||||
#include <ipmitool/ipmi_pef.h>
|
||||
#include <ipmitool/ipmi_oem.h>
|
||||
#include <ipmitool/ipmi_ekanalyzer.h>
|
||||
#include <ipmitool/ipmi_picmg.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_ALL_OPTIONS
|
||||
# define OPTION_STRING "I:hVvcgsEao:H:P:f:U:p:C:L:A:t:m:S:l:b:e:k:"
|
||||
# define OPTION_STRING "I:hVvcgsEKYao:H:d:P:f:U:p:C:L:A:t:T:m:z:S:l:b:B:e:k:y:O:R:N:D:"
|
||||
#else
|
||||
# define OPTION_STRING "I:hVvcH:f:U:p:S:"
|
||||
# define OPTION_STRING "I:hVvcH:f:U:p:d:S:D:"
|
||||
#endif
|
||||
|
||||
extern int verbose;
|
||||
@ -84,13 +84,7 @@ extern int csv_output;
|
||||
extern const struct valstr ipmi_privlvl_vals[];
|
||||
extern const struct valstr ipmi_authtype_session_vals[];
|
||||
|
||||
/* defined in ipmishell.c */
|
||||
#ifdef HAVE_READLINE
|
||||
extern int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
#endif
|
||||
extern int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
extern int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
static struct ipmi_intf * ipmi_main_intf = NULL;
|
||||
|
||||
/* ipmi_password_file_read - Open file and read password from it
|
||||
*
|
||||
@ -107,28 +101,31 @@ ipmi_password_file_read(char * filename)
|
||||
char * pass = NULL;
|
||||
int l;
|
||||
|
||||
pass = malloc(16);
|
||||
pass = malloc(21);
|
||||
if (pass == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(pass, 0, 21);
|
||||
fp = ipmi_open_file_read((const char *)filename);
|
||||
if (fp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to open password file %s",
|
||||
filename);
|
||||
filename);
|
||||
free(pass);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* read in id */
|
||||
if (fgets(pass, 16, fp) == NULL) {
|
||||
if (fgets(pass, 21, fp) == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to read password from file %s",
|
||||
filename);
|
||||
filename);
|
||||
free(pass);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* remove trailing whitespace */
|
||||
/* remove trailing whitespace */
|
||||
l = strcspn(pass, " \r\n\t");
|
||||
if (l > 0) {
|
||||
pass[l] = '\0';
|
||||
@ -203,6 +200,7 @@ ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv)
|
||||
cmd = intf->cmdlist;
|
||||
if (strncmp(cmd->name, "default", 7) == 0)
|
||||
return cmd->func(intf, argc+1, argv-1);
|
||||
|
||||
lprintf(LOG_ERR, "Invalid command: %s", name);
|
||||
ipmi_cmd_print(intf->cmdlist);
|
||||
return -1;
|
||||
@ -219,26 +217,39 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
|
||||
lprintf(LOG_NOTICE, " -V Show version information");
|
||||
lprintf(LOG_NOTICE, " -v Verbose (can use multiple times)");
|
||||
lprintf(LOG_NOTICE, " -c Display output in comma separated format");
|
||||
lprintf(LOG_NOTICE, " -d N Specify a /dev/ipmiN device to use (default=0)");
|
||||
lprintf(LOG_NOTICE, " -I intf Interface to use");
|
||||
lprintf(LOG_NOTICE, " -H hostname Remote host name for LAN interface");
|
||||
lprintf(LOG_NOTICE, " -p port Remote RMCP port [default=623]");
|
||||
lprintf(LOG_NOTICE, " -U username Remote session username");
|
||||
lprintf(LOG_NOTICE, " -f file Read remote session password from file");
|
||||
lprintf(LOG_NOTICE, " -z size Change Size of Communication Channel (OEM)");
|
||||
lprintf(LOG_NOTICE, " -S sdr Use local file for remote SDR cache");
|
||||
lprintf(LOG_NOTICE, " -D tty:b[:s] Specify the serial device, baud rate to use");
|
||||
lprintf(LOG_NOTICE, " and, optionally, specify that interface is the system one");
|
||||
#ifdef ENABLE_ALL_OPTIONS
|
||||
lprintf(LOG_NOTICE, " -a Prompt for remote password");
|
||||
lprintf(LOG_NOTICE, " -Y Prompt for the Kg key for IPMIv2 authentication");
|
||||
lprintf(LOG_NOTICE, " -e char Set SOL escape character");
|
||||
lprintf(LOG_NOTICE, " -C ciphersuite Cipher suite to be used by lanplus interface");
|
||||
lprintf(LOG_NOTICE, " -k key Use Kg key for IPMIv2 authentication");
|
||||
lprintf(LOG_NOTICE, " -y hex_key Use hexadecimal-encoded Kg key for IPMIv2 authentication");
|
||||
lprintf(LOG_NOTICE, " -L level Remote session privilege level [default=ADMINISTRATOR]");
|
||||
lprintf(LOG_NOTICE, " Append a '+' to use name/privilege lookup in RAKP1");
|
||||
lprintf(LOG_NOTICE, " -A authtype Force use of auth type NONE, PASSWORD, MD2, MD5 or OEM");
|
||||
lprintf(LOG_NOTICE, " -P password Remote session password");
|
||||
lprintf(LOG_NOTICE, " -E Read password from IPMI_PASSWORD environment variable");
|
||||
lprintf(LOG_NOTICE, " -K Read kgkey from IPMI_KGKEY environment variable");
|
||||
lprintf(LOG_NOTICE, " -m address Set local IPMB address");
|
||||
lprintf(LOG_NOTICE, " -b channel Set destination channel for bridged request");
|
||||
lprintf(LOG_NOTICE, " -l lun Set destination lun for raw commands");
|
||||
lprintf(LOG_NOTICE, " -t address Bridge request to remote target address");
|
||||
lprintf(LOG_NOTICE, " -B channel Set transit channel for bridged request (dual bridge)");
|
||||
lprintf(LOG_NOTICE, " -T address Set transit address for bridge request (dual bridge)");
|
||||
lprintf(LOG_NOTICE, " -l lun Set destination lun for raw commands");
|
||||
lprintf(LOG_NOTICE, " -o oemtype Setup for OEM (use 'list' to see available OEM types)");
|
||||
lprintf(LOG_NOTICE, " -O seloem Use file for OEM SEL event descriptions");
|
||||
lprintf(LOG_NOTICE, " -N seconds Specify timeout for lan [default=2] / lanplus [default=1] interface");
|
||||
lprintf(LOG_NOTICE, " -R retry Set the number of retries for lan/lanplus interface [default=4]");
|
||||
#endif
|
||||
lprintf(LOG_NOTICE, "");
|
||||
|
||||
@ -247,7 +258,85 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
|
||||
if (cmdlist != NULL)
|
||||
ipmi_cmd_print(cmdlist);
|
||||
}
|
||||
/* ipmi_catch_sigint - Handle the interrupt signal (Ctrl-C), close the
|
||||
* interface, and exit ipmitool with error (-1)
|
||||
*
|
||||
* This insures that the IOL session gets freed
|
||||
* for other callers.
|
||||
*
|
||||
* returns -1
|
||||
*/
|
||||
void ipmi_catch_sigint()
|
||||
{
|
||||
if (ipmi_main_intf != NULL) {
|
||||
printf("\nSIGN INT: Close Interface %s\n",ipmi_main_intf->desc);
|
||||
ipmi_main_intf->close(ipmi_main_intf);
|
||||
}
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* ipmi_parse_hex - convert hexadecimal numbers to ascii string
|
||||
* Input string must be composed of two-characer hexadecimal numbers.
|
||||
* There is no separator between the numbers. Each number results in one character
|
||||
* of the converted string.
|
||||
*
|
||||
* Example: ipmi_parse_hex("50415353574F5244") returns 'PASSWORD'
|
||||
*
|
||||
* @param str: input string. It must contain only even number of '0'-'9','a'-'f' and 'A-F' characters.
|
||||
* @returns converted ascii string
|
||||
* @returns NULL on error
|
||||
*/
|
||||
static unsigned char *
|
||||
ipmi_parse_hex(const char *str)
|
||||
{
|
||||
const char * p;
|
||||
unsigned char * out, *q;
|
||||
unsigned char b = 0;
|
||||
int shift = 4;
|
||||
|
||||
if (strlen(str) == 0)
|
||||
return NULL;
|
||||
|
||||
if (strlen(str) % 2 != 0) {
|
||||
lprintf(LOG_ERR, "Number of hex_kg characters is not even");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strlen(str) > (IPMI_KG_BUFFER_SIZE-1)*2) {
|
||||
lprintf(LOG_ERR, "Kg key is too long");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
out = calloc(IPMI_KG_BUFFER_SIZE, sizeof(unsigned char));
|
||||
if (out == NULL) {
|
||||
lprintf(LOG_ERR, "malloc failure");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (p = str, q = out; *p; p++) {
|
||||
if (!isxdigit(*p)) {
|
||||
lprintf(LOG_ERR, "Kg_hex is not hexadecimal number");
|
||||
free(out);
|
||||
out = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (*p < 'A') /* it must be 0-9 */
|
||||
b = *p - '0';
|
||||
else /* it's A-F or a-f */
|
||||
b = (*p | 0x20) - 'a' + 10; /* convert to lowercase and to 10-15 */
|
||||
|
||||
*q = *q + b << shift;
|
||||
if (shift)
|
||||
shift = 0;
|
||||
else {
|
||||
shift = 4;
|
||||
q++;
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/* ipmi_parse_options - helper function to handle parsing command line options
|
||||
*
|
||||
@ -261,18 +350,26 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
|
||||
*/
|
||||
int
|
||||
ipmi_main(int argc, char ** argv,
|
||||
struct ipmi_cmd * cmdlist,
|
||||
struct ipmi_intf_support * intflist)
|
||||
struct ipmi_cmd * cmdlist,
|
||||
struct ipmi_intf_support * intflist)
|
||||
{
|
||||
struct ipmi_intf * intf = NULL;
|
||||
struct ipmi_intf_support * sup;
|
||||
int privlvl = 0;
|
||||
uint8_t target_addr = 0;
|
||||
uint8_t target_channel = 0;
|
||||
|
||||
uint8_t transit_addr = 0;
|
||||
uint8_t transit_channel = 0;
|
||||
uint8_t target_lun = 0;
|
||||
uint8_t my_addr = 0;
|
||||
uint8_t arg_addr = 0, addr;
|
||||
uint16_t my_long_packet_size=0;
|
||||
uint8_t my_long_packet_set=0;
|
||||
uint8_t lookupbit = 0x10; /* use name-only lookup by default */
|
||||
int retry = 0;
|
||||
uint32_t timeout = 0;
|
||||
int authtype = -1;
|
||||
char * tmp = NULL;
|
||||
char * tmp_pass = NULL;
|
||||
char * tmp_env = NULL;
|
||||
char * hostname = NULL;
|
||||
char * username = NULL;
|
||||
char * password = NULL;
|
||||
@ -280,21 +377,29 @@ ipmi_main(int argc, char ** argv,
|
||||
char * progname = NULL;
|
||||
char * oemtype = NULL;
|
||||
char * sdrcache = NULL;
|
||||
char * kgkey = NULL;
|
||||
unsigned char * kgkey = NULL;
|
||||
char * seloem = NULL;
|
||||
int port = 0;
|
||||
int devnum = 0;
|
||||
int cipher_suite_id = 3; /* See table 22-19 of the IPMIv2 spec */
|
||||
int argflag, i, found;
|
||||
int rc = -1;
|
||||
char sol_escape_char = SOL_ESCAPE_CHARACTER_DEFAULT;
|
||||
char * devfile = NULL;
|
||||
|
||||
/* save program name */
|
||||
progname = strrchr(argv[0], '/');
|
||||
progname = ((progname == NULL) ? argv[0] : progname+1);
|
||||
signal(SIGINT, ipmi_catch_sigint);
|
||||
|
||||
while ((argflag = getopt(argc, (char **)argv, OPTION_STRING)) != -1)
|
||||
{
|
||||
switch (argflag) {
|
||||
case 'I':
|
||||
if (intfname) {
|
||||
free(intfname);
|
||||
intfname = NULL;
|
||||
}
|
||||
intfname = strdup(optarg);
|
||||
if (intfname == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
@ -304,8 +409,8 @@ ipmi_main(int argc, char ** argv,
|
||||
found = 0;
|
||||
for (sup=intflist; sup->name != NULL; sup++) {
|
||||
if (strncmp(sup->name, intfname, strlen(intfname)) == 0 &&
|
||||
strncmp(sup->name, intfname, strlen(sup->name)) == 0 &&
|
||||
sup->supported == 1)
|
||||
strncmp(sup->name, intfname, strlen(sup->name)) == 0 &&
|
||||
sup->supported == 1)
|
||||
found = 1;
|
||||
}
|
||||
if (!found) {
|
||||
@ -324,11 +429,46 @@ ipmi_main(int argc, char ** argv,
|
||||
rc = 0;
|
||||
goto out_free;
|
||||
break;
|
||||
case 'd':
|
||||
if (str2int(optarg, &devnum) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-d'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
/* Check if device number is -gt 0; I couldn't find limit for
|
||||
* kernels > 2.6, thus right side is unlimited.
|
||||
*/
|
||||
if (devnum < 0) {
|
||||
lprintf(LOG_ERR, "Device number %i is out of range.", devnum);
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
port = atoi(optarg);
|
||||
if (str2int(optarg, &port) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-p'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
/* Check if port is -gt 0 && port is -lt 65535 */
|
||||
if (port < 0 || port > 65535) {
|
||||
lprintf(LOG_ERR, "Port number %i is out of range.", port);
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'C':
|
||||
cipher_suite_id = atoi(optarg);
|
||||
if (str2int(optarg, &cipher_suite_id) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-C'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
/* add check Cipher is -gt 0 */
|
||||
if (cipher_suite_id < 0) {
|
||||
lprintf(LOG_ERR, "Cipher suite ID %i is invalid.", cipher_suite_id);
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'v':
|
||||
verbose++;
|
||||
@ -337,6 +477,10 @@ ipmi_main(int argc, char ** argv,
|
||||
csv_output = 1;
|
||||
break;
|
||||
case 'H':
|
||||
if (hostname) {
|
||||
free(hostname);
|
||||
hostname = NULL;
|
||||
}
|
||||
hostname = strdup(optarg);
|
||||
if (hostname == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
@ -344,23 +488,28 @@ ipmi_main(int argc, char ** argv,
|
||||
}
|
||||
break;
|
||||
case 'f':
|
||||
if (password)
|
||||
if (password) {
|
||||
free(password);
|
||||
password = NULL;
|
||||
}
|
||||
password = ipmi_password_file_read(optarg);
|
||||
if (password == NULL)
|
||||
lprintf(LOG_ERR, "Unable to read password "
|
||||
"from file %s", optarg);
|
||||
"from file %s", optarg);
|
||||
break;
|
||||
case 'a':
|
||||
#ifdef HAVE_GETPASSPHRASE
|
||||
tmp = getpassphrase("Password: ");
|
||||
tmp_pass = getpassphrase("Password: ");
|
||||
#else
|
||||
tmp = getpass("Password: ");
|
||||
tmp_pass = getpass("Password: ");
|
||||
#endif
|
||||
if (tmp != NULL) {
|
||||
if (password)
|
||||
if (tmp_pass != NULL) {
|
||||
if (password) {
|
||||
free(password);
|
||||
password = strdup(tmp);
|
||||
password = NULL;
|
||||
}
|
||||
password = strdup(tmp_pass);
|
||||
tmp_pass = NULL;
|
||||
if (password == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
@ -368,13 +517,69 @@ ipmi_main(int argc, char ** argv,
|
||||
}
|
||||
break;
|
||||
case 'k':
|
||||
if (kgkey) {
|
||||
free(kgkey);
|
||||
kgkey = NULL;
|
||||
}
|
||||
kgkey = strdup(optarg);
|
||||
if (kgkey == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'K':
|
||||
if ((tmp_env = getenv("IPMI_KGKEY"))) {
|
||||
if (kgkey) {
|
||||
free(kgkey);
|
||||
kgkey = NULL;
|
||||
}
|
||||
kgkey = strdup(tmp_env);
|
||||
if (kgkey == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
} else {
|
||||
lprintf(LOG_WARN, "Unable to read kgkey from environment");
|
||||
}
|
||||
break;
|
||||
case 'y':
|
||||
if (kgkey) {
|
||||
free(kgkey);
|
||||
kgkey = NULL;
|
||||
}
|
||||
kgkey = ipmi_parse_hex(optarg);
|
||||
if (kgkey == NULL) {
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'Y':
|
||||
#ifdef HAVE_GETPASSPHRASE
|
||||
tmp_pass = getpassphrase("Key: ");
|
||||
#else
|
||||
tmp_pass = getpass("Key: ");
|
||||
#endif
|
||||
if (tmp_pass != NULL) {
|
||||
if (kgkey) {
|
||||
free(kgkey);
|
||||
kgkey = NULL;
|
||||
}
|
||||
kgkey = strdup(tmp_pass);
|
||||
tmp_pass = NULL;
|
||||
if (kgkey == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'U':
|
||||
if (username) {
|
||||
free(username);
|
||||
username = NULL;
|
||||
}
|
||||
if (strlen(optarg) > 16) {
|
||||
lprintf(LOG_ERR, "Username is too long (> 16 bytes)");
|
||||
goto out_free;
|
||||
}
|
||||
username = strdup(optarg);
|
||||
if (username == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
@ -382,36 +587,67 @@ ipmi_main(int argc, char ** argv,
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
if (sdrcache) {
|
||||
free(sdrcache);
|
||||
sdrcache = NULL;
|
||||
}
|
||||
sdrcache = strdup(optarg);
|
||||
if (sdrcache == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'D':
|
||||
/* check for subsequent instance of -D */
|
||||
if (devfile) {
|
||||
/* free memory for previous string */
|
||||
free(devfile);
|
||||
}
|
||||
devfile = strdup(optarg);
|
||||
if (devfile == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
#ifdef ENABLE_ALL_OPTIONS
|
||||
case 'o':
|
||||
if (oemtype) {
|
||||
free(oemtype);
|
||||
oemtype = NULL;
|
||||
}
|
||||
oemtype = strdup(optarg);
|
||||
if (oemtype == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
if (strncmp(oemtype, "list", 4) == 0 ||
|
||||
strncmp(oemtype, "help", 4) == 0) {
|
||||
strncmp(oemtype, "help", 4) == 0) {
|
||||
ipmi_oem_print();
|
||||
rc = 0;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'g':
|
||||
/* backwards compatible oem hack */
|
||||
if (oemtype) {
|
||||
free(oemtype);
|
||||
oemtype = NULL;
|
||||
}
|
||||
oemtype = strdup("intelwv2");
|
||||
break;
|
||||
case 's':
|
||||
/* backwards compatible oem hack */
|
||||
if (oemtype) {
|
||||
free(oemtype);
|
||||
oemtype = NULL;
|
||||
}
|
||||
oemtype = strdup("supermicro");
|
||||
break;
|
||||
case 'P':
|
||||
if (password)
|
||||
if (password) {
|
||||
free(password);
|
||||
password = NULL;
|
||||
}
|
||||
password = strdup(optarg);
|
||||
if (password == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
@ -423,21 +659,23 @@ ipmi_main(int argc, char ** argv,
|
||||
memset(optarg, 'X', i);
|
||||
break;
|
||||
case 'E':
|
||||
if ((tmp = getenv("IPMITOOL_PASSWORD")))
|
||||
{
|
||||
if (password)
|
||||
if ((tmp_env = getenv("IPMITOOL_PASSWORD"))) {
|
||||
if (password) {
|
||||
free(password);
|
||||
password = strdup(tmp);
|
||||
password = NULL;
|
||||
}
|
||||
password = strdup(tmp_env);
|
||||
if (password == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
}
|
||||
else if ((tmp = getenv("IPMI_PASSWORD")))
|
||||
{
|
||||
if (password)
|
||||
else if ((tmp_env = getenv("IPMI_PASSWORD"))) {
|
||||
if (password) {
|
||||
free(password);
|
||||
password = strdup(tmp);
|
||||
password = NULL;
|
||||
}
|
||||
password = strdup(tmp_env);
|
||||
if (password == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
@ -448,28 +686,97 @@ ipmi_main(int argc, char ** argv,
|
||||
}
|
||||
break;
|
||||
case 'L':
|
||||
i = strlen(optarg);
|
||||
if ((i > 0) && (optarg[i-1] == '+')) {
|
||||
lookupbit = 0;
|
||||
optarg[i-1] = 0;
|
||||
}
|
||||
privlvl = str2val(optarg, ipmi_privlvl_vals);
|
||||
if (privlvl == 0xFF)
|
||||
if (privlvl == 0xFF) {
|
||||
lprintf(LOG_WARN, "Invalid privilege level %s", optarg);
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
authtype = str2val(optarg, ipmi_authtype_session_vals);
|
||||
break;
|
||||
case 't':
|
||||
target_addr = (uint8_t)strtol(optarg, NULL, 0);
|
||||
if (str2uchar(optarg, &target_addr) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-t'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'b':
|
||||
target_channel = (uint8_t)strtol(optarg, NULL, 0);
|
||||
if (str2uchar(optarg, &target_channel) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-b'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'T':
|
||||
if (str2uchar(optarg, &transit_addr) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-T'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'B':
|
||||
if (str2uchar(optarg, &transit_channel) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-B'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
target_lun = (uint8_t)strtol(optarg, NULL, 0);
|
||||
if (str2uchar(optarg, &target_lun) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-l'.");
|
||||
rc = 1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
my_addr = (uint8_t)strtol(optarg, NULL, 0);
|
||||
if (str2uchar(optarg, &arg_addr) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-m'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'e':
|
||||
sol_escape_char = optarg[0];
|
||||
break;
|
||||
case 'O':
|
||||
if (seloem) {
|
||||
free(seloem);
|
||||
seloem = NULL;
|
||||
}
|
||||
seloem = strdup(optarg);
|
||||
if (seloem == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'z':
|
||||
if (str2ushort(optarg, &my_long_packet_size) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-z'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
/* Retry and Timeout */
|
||||
case 'R':
|
||||
if (str2int(optarg, &retry) != 0 || retry < 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-R'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
case 'N':
|
||||
if (str2uint(optarg, &timeout) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter given or out of range for '-N'.");
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ipmi_option_usage(progname, cmdlist, intflist);
|
||||
@ -479,7 +786,7 @@ ipmi_main(int argc, char ** argv,
|
||||
|
||||
/* check for command before doing anything */
|
||||
if (argc-optind > 0 &&
|
||||
strncmp(argv[optind], "help", 4) == 0) {
|
||||
strncmp(argv[optind], "help", 4) == 0) {
|
||||
ipmi_cmd_print(cmdlist);
|
||||
rc = 0;
|
||||
goto out_free;
|
||||
@ -494,14 +801,15 @@ ipmi_main(int argc, char ** argv,
|
||||
* then prompt the user.
|
||||
*/
|
||||
if (hostname != NULL && password == NULL &&
|
||||
(authtype != IPMI_SESSION_AUTHTYPE_NONE || authtype < 0)) {
|
||||
(authtype != IPMI_SESSION_AUTHTYPE_NONE || authtype < 0)) {
|
||||
#ifdef HAVE_GETPASSPHRASE
|
||||
tmp = getpassphrase("Password: ");
|
||||
tmp_pass = getpassphrase("Password: ");
|
||||
#else
|
||||
tmp = getpass("Password: ");
|
||||
tmp_pass = getpass("Password: ");
|
||||
#endif
|
||||
if (tmp != NULL) {
|
||||
password = strdup(tmp);
|
||||
if (tmp_pass != NULL) {
|
||||
password = strdup(tmp_pass);
|
||||
tmp_pass = NULL;
|
||||
if (password == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
@ -522,9 +830,21 @@ ipmi_main(int argc, char ** argv,
|
||||
}
|
||||
}
|
||||
|
||||
if (password != NULL && intfname != NULL) {
|
||||
if (strcmp(intfname, "lan") == 0 && strlen(password) > 16) {
|
||||
lprintf(LOG_ERR, "%s: password is longer than 16 bytes.", intfname);
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
} else if (strcmp(intfname, "lanplus") == 0 && strlen(password) > 20) {
|
||||
lprintf(LOG_ERR, "%s: password is longer than 20 bytes.", intfname);
|
||||
rc = -1;
|
||||
goto out_free;
|
||||
}
|
||||
} /* if (password != NULL && intfname != NULL) */
|
||||
|
||||
/* load interface */
|
||||
intf = ipmi_intf_load(intfname);
|
||||
if (intf == NULL) {
|
||||
ipmi_main_intf = ipmi_intf_load(intfname);
|
||||
if (ipmi_main_intf == NULL) {
|
||||
lprintf(LOG_ERR, "Error loading interface %s", intfname);
|
||||
goto out_free;
|
||||
}
|
||||
@ -534,83 +854,201 @@ ipmi_main(int argc, char ** argv,
|
||||
|
||||
/* run OEM setup if found */
|
||||
if (oemtype != NULL &&
|
||||
ipmi_oem_setup(intf, oemtype) < 0) {
|
||||
ipmi_oem_setup(ipmi_main_intf, oemtype) < 0) {
|
||||
lprintf(LOG_ERR, "OEM setup for \"%s\" failed", oemtype);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
/* set session variables */
|
||||
if (hostname != NULL)
|
||||
ipmi_intf_session_set_hostname(intf, hostname);
|
||||
ipmi_intf_session_set_hostname(ipmi_main_intf, hostname);
|
||||
if (username != NULL)
|
||||
ipmi_intf_session_set_username(intf, username);
|
||||
ipmi_intf_session_set_username(ipmi_main_intf, username);
|
||||
if (password != NULL)
|
||||
ipmi_intf_session_set_password(intf, password);
|
||||
ipmi_intf_session_set_password(ipmi_main_intf, password);
|
||||
if (kgkey != NULL)
|
||||
ipmi_intf_session_set_kgkey(intf, kgkey);
|
||||
ipmi_intf_session_set_kgkey(ipmi_main_intf, kgkey);
|
||||
if (port > 0)
|
||||
ipmi_intf_session_set_port(intf, port);
|
||||
ipmi_intf_session_set_port(ipmi_main_intf, port);
|
||||
if (authtype >= 0)
|
||||
ipmi_intf_session_set_authtype(intf, (uint8_t)authtype);
|
||||
ipmi_intf_session_set_authtype(ipmi_main_intf, (uint8_t)authtype);
|
||||
if (privlvl > 0)
|
||||
ipmi_intf_session_set_privlvl(intf, (uint8_t)privlvl);
|
||||
ipmi_intf_session_set_privlvl(ipmi_main_intf, (uint8_t)privlvl);
|
||||
else
|
||||
ipmi_intf_session_set_privlvl(intf,
|
||||
IPMI_SESSION_PRIV_ADMIN); /* default */
|
||||
ipmi_intf_session_set_privlvl(ipmi_main_intf,
|
||||
IPMI_SESSION_PRIV_ADMIN); /* default */
|
||||
/* Adding retry and timeout for interface that support it */
|
||||
if (retry > 0)
|
||||
ipmi_intf_session_set_retry(ipmi_main_intf, retry);
|
||||
if (timeout > 0)
|
||||
ipmi_intf_session_set_timeout(ipmi_main_intf, timeout);
|
||||
|
||||
ipmi_intf_session_set_sol_escape_char(intf, sol_escape_char);
|
||||
ipmi_intf_session_set_cipher_suite_id(intf, cipher_suite_id);
|
||||
ipmi_intf_session_set_lookupbit(ipmi_main_intf, lookupbit);
|
||||
ipmi_intf_session_set_sol_escape_char(ipmi_main_intf, sol_escape_char);
|
||||
ipmi_intf_session_set_cipher_suite_id(ipmi_main_intf, cipher_suite_id);
|
||||
|
||||
/* setup destination lun if given */
|
||||
intf->target_lun = target_lun ;
|
||||
ipmi_main_intf->devnum = devnum;
|
||||
|
||||
/* setup destination channel if given */
|
||||
intf->target_channel = target_channel ;
|
||||
/* setup device file if given */
|
||||
ipmi_main_intf->devfile = devfile;
|
||||
|
||||
/* setup IPMB local and target address if given */
|
||||
intf->my_addr = my_addr ? : IPMI_BMC_SLAVE_ADDR;
|
||||
if (target_addr > 0) {
|
||||
/* need to open the interface first */
|
||||
if (intf->open != NULL)
|
||||
intf->open(intf);
|
||||
intf->target_addr = target_addr;
|
||||
/* must be admin level to do this over lan */
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
/* Open the interface with the specified or default IPMB address */
|
||||
ipmi_main_intf->my_addr = arg_addr ? arg_addr : IPMI_BMC_SLAVE_ADDR;
|
||||
if (ipmi_main_intf->open != NULL)
|
||||
ipmi_main_intf->open(ipmi_main_intf);
|
||||
|
||||
/*
|
||||
* Attempt picmg discovery of the actual interface address unless
|
||||
* the users specified an address.
|
||||
* Address specification always overrides discovery
|
||||
*/
|
||||
if (picmg_discover(ipmi_main_intf) && !arg_addr) {
|
||||
lprintf(LOG_DEBUG, "Running PICMG Get Address Info");
|
||||
addr = ipmi_picmg_ipmb_address(ipmi_main_intf);
|
||||
lprintf(LOG_INFO, "Discovered IPMB-0 address 0x%x", addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we discovered the ipmb address and it is not the same as what we
|
||||
* used for open, Set the discovered IPMB address as my address if the
|
||||
* interface supports it.
|
||||
*/
|
||||
if (addr != 0 && addr != ipmi_main_intf->my_addr &&
|
||||
ipmi_main_intf->set_my_addr) {
|
||||
/*
|
||||
* Only set the interface address on interfaces which support
|
||||
* it
|
||||
*/
|
||||
(void) ipmi_main_intf->set_my_addr(ipmi_main_intf, addr);
|
||||
}
|
||||
|
||||
/* If bridging addresses are specified, handle them */
|
||||
if (transit_addr > 0 || target_addr > 0) {
|
||||
/* sanity check, transit makes no sense without a target */
|
||||
if ((transit_addr != 0 || transit_channel != 0) &&
|
||||
target_addr == 0) {
|
||||
lprintf(LOG_ERR,
|
||||
"Transit address/channel %#x/%#x ignored. "
|
||||
"Target address must be specified!",
|
||||
transit_addr, transit_channel);
|
||||
goto out_free;
|
||||
}
|
||||
ipmi_main_intf->target_addr = target_addr;
|
||||
ipmi_main_intf->target_lun = target_lun ;
|
||||
ipmi_main_intf->target_channel = target_channel ;
|
||||
|
||||
ipmi_main_intf->transit_addr = transit_addr;
|
||||
ipmi_main_intf->transit_channel = transit_channel;
|
||||
|
||||
|
||||
/* must be admin level to do this over lan */
|
||||
ipmi_intf_session_set_privlvl(ipmi_main_intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
/* Get the ipmb address of the targeted entity */
|
||||
ipmi_main_intf->target_ipmb_addr =
|
||||
ipmi_picmg_ipmb_address(ipmi_main_intf);
|
||||
lprintf(LOG_DEBUG, "Specified addressing Target %#x:%#x Transit %#x:%#x",
|
||||
ipmi_main_intf->target_addr,
|
||||
ipmi_main_intf->target_channel,
|
||||
ipmi_main_intf->transit_addr,
|
||||
ipmi_main_intf->transit_channel);
|
||||
if (ipmi_main_intf->target_ipmb_addr) {
|
||||
lprintf(LOG_INFO, "Discovered Target IPMB-0 address %#x",
|
||||
ipmi_main_intf->target_ipmb_addr);
|
||||
}
|
||||
}
|
||||
|
||||
lprintf(LOG_DEBUG, "Interface address: my_addr %#x "
|
||||
"transit %#x:%#x target %#x:%#x "
|
||||
"ipmb_target %#x\n",
|
||||
ipmi_main_intf->my_addr,
|
||||
ipmi_main_intf->transit_addr,
|
||||
ipmi_main_intf->transit_channel,
|
||||
ipmi_main_intf->target_addr,
|
||||
ipmi_main_intf->target_channel,
|
||||
ipmi_main_intf->target_ipmb_addr);
|
||||
|
||||
/* parse local SDR cache if given */
|
||||
if (sdrcache != NULL) {
|
||||
ipmi_sdr_list_cache_fromfile(intf, sdrcache);
|
||||
ipmi_sdr_list_cache_fromfile(ipmi_main_intf, sdrcache);
|
||||
}
|
||||
/* Parse SEL OEM file if given */
|
||||
if (seloem != NULL) {
|
||||
ipmi_sel_oem_init(seloem);
|
||||
}
|
||||
|
||||
intf->cmdlist = cmdlist;
|
||||
/* Enable Big Buffer when requested */
|
||||
ipmi_main_intf->channel_buf_size = 0;
|
||||
if ( my_long_packet_size != 0 ) {
|
||||
printf("Setting large buffer to %i\n", my_long_packet_size);
|
||||
if (ipmi_kontronoem_set_large_buffer( ipmi_main_intf, my_long_packet_size ) == 0)
|
||||
{
|
||||
my_long_packet_set = 1;
|
||||
ipmi_main_intf->channel_buf_size = my_long_packet_size;
|
||||
}
|
||||
}
|
||||
|
||||
ipmi_main_intf->cmdlist = cmdlist;
|
||||
|
||||
/* now we finally run the command */
|
||||
if (argc-optind > 0)
|
||||
rc = ipmi_cmd_run(intf, argv[optind], argc-optind-1, &(argv[optind+1]));
|
||||
rc = ipmi_cmd_run(ipmi_main_intf, argv[optind], argc-optind-1,
|
||||
&(argv[optind+1]));
|
||||
else
|
||||
rc = ipmi_cmd_run(intf, NULL, 0, NULL);
|
||||
rc = ipmi_cmd_run(ipmi_main_intf, NULL, 0, NULL);
|
||||
|
||||
if (my_long_packet_set == 1) {
|
||||
/* Restore defaults */
|
||||
ipmi_kontronoem_set_large_buffer( ipmi_main_intf, 0 );
|
||||
}
|
||||
|
||||
/* clean repository caches */
|
||||
ipmi_cleanup(intf);
|
||||
ipmi_cleanup(ipmi_main_intf);
|
||||
|
||||
/* call interface close function if available */
|
||||
if (intf->opened > 0 && intf->close != NULL)
|
||||
intf->close(intf);
|
||||
if (ipmi_main_intf->opened > 0 && ipmi_main_intf->close != NULL)
|
||||
ipmi_main_intf->close(ipmi_main_intf);
|
||||
|
||||
out_free:
|
||||
out_free:
|
||||
log_halt();
|
||||
|
||||
if (intfname != NULL)
|
||||
if (intfname != NULL) {
|
||||
free(intfname);
|
||||
if (hostname != NULL)
|
||||
intfname = NULL;
|
||||
}
|
||||
if (hostname != NULL) {
|
||||
free(hostname);
|
||||
if (username != NULL)
|
||||
hostname = NULL;
|
||||
}
|
||||
if (username != NULL) {
|
||||
free(username);
|
||||
if (password != NULL)
|
||||
username = NULL;
|
||||
}
|
||||
if (password != NULL) {
|
||||
free(password);
|
||||
if (oemtype != NULL)
|
||||
password = NULL;
|
||||
}
|
||||
if (oemtype != NULL) {
|
||||
free(oemtype);
|
||||
oemtype = NULL;
|
||||
}
|
||||
if (seloem != NULL) {
|
||||
free(seloem);
|
||||
seloem = NULL;
|
||||
}
|
||||
if (kgkey != NULL) {
|
||||
free(kgkey);
|
||||
kgkey = NULL;
|
||||
}
|
||||
if (sdrcache != NULL) {
|
||||
free(sdrcache);
|
||||
sdrcache = NULL;
|
||||
}
|
||||
if (devfile) {
|
||||
free(devfile);
|
||||
devfile = NULL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,21 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -49,6 +45,10 @@
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int ipmi_sysinfo_main(struct ipmi_intf *intf, int argc, char ** argv,
|
||||
int is_set);
|
||||
static void printf_sysinfo_usage(int full_help);
|
||||
|
||||
/* ipmi_mc_reset - attempt to reset an MC
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
@ -65,6 +65,7 @@ ipmi_mc_reset(struct ipmi_intf * intf, int cmd)
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
if( !intf->opened )
|
||||
intf->open(intf);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
@ -80,12 +81,26 @@ ipmi_mc_reset(struct ipmi_intf * intf, int cmd)
|
||||
if (cmd == BMC_COLD_RESET)
|
||||
intf->abort = 1;
|
||||
|
||||
if (cmd == BMC_COLD_RESET && rsp == NULL) {
|
||||
/* This is expected. See 20.2 Cold Reset Command, p.243, IPMIv2.0 rev1.0 */
|
||||
} else if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "MC reset command failed.");
|
||||
return (-1);
|
||||
} else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "MC reset command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
printf("Sent %s reset command to MC\n",
|
||||
(cmd == BMC_WARM_RESET) ? "warm" : "cold");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct bmc_enables_data {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t oem2 : 1;
|
||||
@ -106,7 +121,10 @@ struct bmc_enables_data {
|
||||
uint8_t oem1 : 1;
|
||||
uint8_t oem2 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct bitfield_data {
|
||||
const char * name;
|
||||
@ -153,20 +171,69 @@ struct bitfield_data mc_enables_bf[] = {
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
static void
|
||||
printf_mc_reset_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "usage: mc reset <warm|cold>");
|
||||
} /* printf_mc_reset_usage(void) */
|
||||
|
||||
static void
|
||||
printf_mc_usage(void)
|
||||
{
|
||||
struct bitfield_data * bf;
|
||||
printf("MC Commands:\n");
|
||||
printf(" reset <warm|cold>\n");
|
||||
printf(" info\n");
|
||||
printf(" selftest\n");
|
||||
printf(" getenables\n");
|
||||
printf(" setenables <option=on|off> ...\n");
|
||||
|
||||
lprintf(LOG_NOTICE, "MC Commands:");
|
||||
lprintf(LOG_NOTICE, " reset <warm|cold>");
|
||||
lprintf(LOG_NOTICE, " guid");
|
||||
lprintf(LOG_NOTICE, " info");
|
||||
lprintf(LOG_NOTICE, " watchdog <get|reset|off>");
|
||||
lprintf(LOG_NOTICE, " selftest");
|
||||
lprintf(LOG_NOTICE, " getenables");
|
||||
lprintf(LOG_NOTICE, " setenables <option=on|off> ...");
|
||||
for (bf = mc_enables_bf; bf->name != NULL; bf++) {
|
||||
printf(" %-20s %s\n", bf->name, bf->desc);
|
||||
lprintf(LOG_NOTICE, " %-20s %s", bf->name, bf->desc);
|
||||
}
|
||||
printf_sysinfo_usage(0);
|
||||
}
|
||||
|
||||
static void
|
||||
printf_sysinfo_usage(int full_help)
|
||||
{
|
||||
if (full_help != 0)
|
||||
lprintf(LOG_NOTICE, "usage:");
|
||||
|
||||
lprintf(LOG_NOTICE, " getsysinfo <argument>");
|
||||
|
||||
if (full_help != 0) {
|
||||
lprintf(LOG_NOTICE,
|
||||
" Retrieves system info from BMC for given argument");
|
||||
}
|
||||
|
||||
lprintf(LOG_NOTICE, " setsysinfo <argument> <string>");
|
||||
|
||||
if (full_help != 0) {
|
||||
lprintf(LOG_NOTICE,
|
||||
" Stores system info string for given argument to BMC");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, " Valid arguments are:");
|
||||
}
|
||||
lprintf(LOG_NOTICE,
|
||||
" primary_os_name Primary operating system name");
|
||||
lprintf(LOG_NOTICE, " os_name Operating system name");
|
||||
lprintf(LOG_NOTICE,
|
||||
" system_name System Name of server(vendor dependent)");
|
||||
lprintf(LOG_NOTICE,
|
||||
" delloem_os_version Running version of operating system");
|
||||
lprintf(LOG_NOTICE, " delloem_url URL of BMC webserver");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
}
|
||||
|
||||
static void
|
||||
print_watchdog_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "usage: watchdog <command>:");
|
||||
lprintf(LOG_NOTICE, " get : Get Current Watchdog settings");
|
||||
lprintf(LOG_NOTICE, " reset : Restart Watchdog timer based on most recent settings");
|
||||
lprintf(LOG_NOTICE, " off : Shut off a running Watchdog timer");
|
||||
}
|
||||
|
||||
/* ipmi_mc_get_enables - print out MC enables
|
||||
@ -224,7 +291,11 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
uint8_t en;
|
||||
int i;
|
||||
|
||||
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
|
||||
if (argc < 1) {
|
||||
printf_mc_usage();
|
||||
return (-1);
|
||||
}
|
||||
else if (strncmp(argv[0], "help", 4) == 0) {
|
||||
printf_mc_usage();
|
||||
return 0;
|
||||
}
|
||||
@ -252,12 +323,12 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (strncmp(argv[i], bf->name, nl) != 0)
|
||||
continue;
|
||||
if (strncmp(argv[i]+nl+1, "off", 3) == 0) {
|
||||
printf("Disabling %s\n", bf->desc);
|
||||
en &= ~bf->mask;
|
||||
printf("Disabling %s\n", bf->desc);
|
||||
en &= ~bf->mask;
|
||||
}
|
||||
else if (strncmp(argv[i]+nl+1, "on", 2) == 0) {
|
||||
printf("Enabling %s\n", bf->desc);
|
||||
en |= bf->mask;
|
||||
printf("Enabling %s\n", bf->desc);
|
||||
en |= bf->mask;
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Unrecognized option: %s", argv[i]);
|
||||
@ -282,7 +353,7 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Global Enables command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -294,14 +365,14 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
/* IPM Device, Get Device ID Command - Additional Device Support */
|
||||
const char *ipm_dev_adtl_dev_support[8] = {
|
||||
"Sensor Device", /* bit 0 */
|
||||
"SDR Repository Device", /* bit 1 */
|
||||
"SEL Device", /* bit 2 */
|
||||
"FRU Inventory Device", /* ... */
|
||||
"IPMB Event Receiver",
|
||||
"IPMB Event Generator",
|
||||
"Bridge",
|
||||
"Chassis Device" /* bit 7 */
|
||||
"Sensor Device", /* bit 0 */
|
||||
"SDR Repository Device", /* bit 1 */
|
||||
"SEL Device", /* bit 2 */
|
||||
"FRU Inventory Device", /* ... */
|
||||
"IPMB Event Receiver",
|
||||
"IPMB Event Generator",
|
||||
"Bridge",
|
||||
"Chassis Device" /* bit 7 */
|
||||
};
|
||||
|
||||
/* ipmi_mc_get_deviceid - print information about this MC
|
||||
@ -318,6 +389,7 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
|
||||
struct ipmi_rq req;
|
||||
struct ipm_devid_rsp *devid;
|
||||
int i;
|
||||
const char *product=NULL;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
@ -336,27 +408,36 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
devid = (struct ipm_devid_rsp *) rsp->data;
|
||||
printf("Device ID : %i\n",
|
||||
printf("Device ID : %i\n",
|
||||
devid->device_id);
|
||||
printf("Device Revision : %i\n",
|
||||
devid->device_revision & IPM_DEV_DEVICE_ID_REV_MASK);
|
||||
printf("Firmware Revision : %u.%x\n",
|
||||
printf("Firmware Revision : %u.%02x\n",
|
||||
devid->fw_rev1 & IPM_DEV_FWREV1_MAJOR_MASK,
|
||||
devid->fw_rev2);
|
||||
printf("IPMI Version : %x.%x\n",
|
||||
IPM_DEV_IPMI_VERSION_MAJOR(devid->ipmi_version),
|
||||
IPM_DEV_IPMI_VERSION_MINOR(devid->ipmi_version));
|
||||
printf("Manufacturer ID : %lu\n",
|
||||
(long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id));
|
||||
printf("Manufacturer Name : %s\n",
|
||||
val2str( (long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id),
|
||||
ipmi_oem_info) );
|
||||
(long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id));
|
||||
printf("Manufacturer Name : %s\n",
|
||||
val2str( (long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id),
|
||||
ipmi_oem_info) );
|
||||
|
||||
printf("Product ID : %u (0x%02x%02x)\n",
|
||||
buf2short((uint8_t *)(devid->product_id)),
|
||||
devid->product_id[1], devid->product_id[0]);
|
||||
|
||||
product=oemval2str(IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id),
|
||||
(devid->product_id[1]<<8)+devid->product_id[0],
|
||||
ipmi_oem_product_info);
|
||||
|
||||
if (product!=NULL) {
|
||||
printf("Product Name : %s\n", product);
|
||||
}
|
||||
|
||||
printf("Device Available : %s\n",
|
||||
(devid->fw_rev1 & IPM_DEV_FWREV1_AVAIL_MASK) ?
|
||||
(devid->fw_rev1 & IPM_DEV_FWREV1_AVAIL_MASK) ?
|
||||
"no" : "yes");
|
||||
printf("Provides Device SDRs : %s\n",
|
||||
(devid->device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) ?
|
||||
@ -367,16 +448,26 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
|
||||
printf(" %s\n", ipm_dev_adtl_dev_support[i]);
|
||||
}
|
||||
}
|
||||
printf("Aux Firmware Rev Info : \n");
|
||||
/* These values could be looked-up by vendor if documented,
|
||||
* so we put them on individual lines for better treatment later
|
||||
*/
|
||||
printf(" 0x%02x\n 0x%02x\n 0x%02x\n 0x%02x\n",
|
||||
devid->aux_fw_rev[0], devid->aux_fw_rev[1],
|
||||
devid->aux_fw_rev[2], devid->aux_fw_rev[3]);
|
||||
if (rsp->data_len == sizeof(*devid)) {
|
||||
printf("Aux Firmware Rev Info : \n");
|
||||
/* These values could be looked-up by vendor if documented,
|
||||
* so we put them on individual lines for better treatment later
|
||||
*/
|
||||
printf(" 0x%02x\n 0x%02x\n 0x%02x\n 0x%02x\n",
|
||||
devid->aux_fw_rev[0],
|
||||
devid->aux_fw_rev[1],
|
||||
devid->aux_fw_rev[2],
|
||||
devid->aux_fw_rev[3]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Structure follow the IPMI V.2 Rev 1.0
|
||||
* See Table 20-10 */
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
|
||||
struct ipmi_guid {
|
||||
uint32_t time_low; /* timestamp low field */
|
||||
uint16_t time_mid; /* timestamp middle field */
|
||||
@ -384,7 +475,10 @@ struct ipmi_guid {
|
||||
uint8_t clock_seq_hi_variant;/* clock sequence high field and variant */
|
||||
uint8_t clock_seq_low; /* clock sequence low field */
|
||||
uint8_t node[6]; /* node */
|
||||
} __attribute__((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* ipmi_mc_get_guid - print this MC GUID
|
||||
*
|
||||
@ -416,19 +510,20 @@ ipmi_mc_get_guid(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
if (rsp->data_len == sizeof(struct ipmi_guid)) {
|
||||
uint8_t tbuf[40];
|
||||
char tbuf[40];
|
||||
time_t s;
|
||||
memset(tbuf, 0, 40);
|
||||
memset(&guid, 0, sizeof(struct ipmi_guid));
|
||||
memcpy(&guid, rsp->data, rsp->data_len);
|
||||
|
||||
/* Kipp - changed order of last field (node) to follow specification */
|
||||
printf("System GUID : %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x\n",
|
||||
guid.time_low, guid.time_mid, guid.time_hi_and_version,
|
||||
guid.clock_seq_hi_variant << 8 | guid.clock_seq_low,
|
||||
guid.node[5], guid.node[4], guid.node[3],
|
||||
guid.node[2], guid.node[1], guid.node[0]);
|
||||
guid.node[0], guid.node[1], guid.node[2],
|
||||
guid.node[3], guid.node[4], guid.node[5]);
|
||||
|
||||
s = (time_t)BSWAP_32(guid.time_low);
|
||||
s = (time_t)guid.time_low; /* Kipp - removed the BSWAP_32, it was not needed here */
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&s));
|
||||
printf("Timestamp : %s\n", tbuf);
|
||||
}
|
||||
@ -457,12 +552,13 @@ static int ipmi_mc_get_selftest(struct ipmi_intf * intf)
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp) {
|
||||
lprintf(LOG_ERR, "No response from devices\n");
|
||||
lprintf(LOG_ERR, "No response from devices\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Bad response: (%s)",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
lprintf(LOG_ERR, "Bad response: (%s)",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -507,24 +603,191 @@ static int ipmi_mc_get_selftest(struct ipmi_intf * intf)
|
||||
printf("controller operational firmware corrupted\n");
|
||||
}
|
||||
}
|
||||
|
||||
else if (sft_res->code == IPM_SFT_CODE_FATAL_ERROR) {
|
||||
printf("Selftest : fatal error\n");
|
||||
printf("Failure code : %02x\n", sft_res->test);
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
else if (sft_res->code == IPM_SFT_CODE_RESERVED) {
|
||||
printf("Selftest: N/A");
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
else {
|
||||
printf("Selttest : device specific\n");
|
||||
printf("Failure code : %02x\n", sft_res->test);
|
||||
printf("Selftest : device specific (%02Xh)\n", sft_res->code);
|
||||
printf("Failure code : %02Xh\n", sft_res->test);
|
||||
rv = 0;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* ipmi_mc_get_watchdog
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
|
||||
const char *wdt_use_string[8] = {
|
||||
"Reserved",
|
||||
"BIOS FRB2",
|
||||
"BIOS/POST",
|
||||
"OS Load",
|
||||
"SMS/OS",
|
||||
"OEM",
|
||||
"Reserved",
|
||||
"Reserved"
|
||||
};
|
||||
|
||||
const char *wdt_action_string[8] = {
|
||||
"No action",
|
||||
"Hard Reset",
|
||||
"Power Down",
|
||||
"Power Cycle",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved"
|
||||
};
|
||||
|
||||
static int
|
||||
ipmi_mc_get_watchdog(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct ipm_get_watchdog_rsp * wdt_res;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = BMC_GET_WATCHDOG_TIMER;
|
||||
req.msg.data_len = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Get Watchdog Timer command failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Get Watchdog Timer command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
wdt_res = (struct ipm_get_watchdog_rsp *) rsp->data;
|
||||
|
||||
printf("Watchdog Timer Use: %s (0x%02x)\n",
|
||||
wdt_use_string[(wdt_res->timer_use & 0x07 )], wdt_res->timer_use);
|
||||
printf("Watchdog Timer Is: %s\n",
|
||||
wdt_res->timer_use & 0x40 ? "Started/Running" : "Stopped");
|
||||
printf("Watchdog Timer Actions: %s (0x%02x)\n",
|
||||
wdt_action_string[(wdt_res->timer_actions&0x07)], wdt_res->timer_actions);
|
||||
printf("Pre-timeout interval: %d seconds\n", wdt_res->pre_timeout);
|
||||
printf("Timer Expiration Flags: 0x%02x\n", wdt_res->timer_use_exp);
|
||||
printf("Initial Countdown: %i sec\n",
|
||||
((wdt_res->initial_countdown_msb << 8) | wdt_res->initial_countdown_lsb)/10);
|
||||
printf("Present Countdown: %i sec\n",
|
||||
(((wdt_res->present_countdown_msb << 8) | wdt_res->present_countdown_lsb)) / 10);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ipmi_mc_shutoff_watchdog
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
static int
|
||||
ipmi_mc_shutoff_watchdog(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char msg_data[6];
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = BMC_SET_WATCHDOG_TIMER;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 6;
|
||||
|
||||
/*
|
||||
* The only set cmd we're allowing is to shut off the timer.
|
||||
* Turning on the timer should be the job of the ipmi watchdog driver.
|
||||
* See 'modinfo ipmi_watchdog' for more info. (NOTE: the reset
|
||||
* command will restart the timer if it's already been initialized.)
|
||||
*
|
||||
* Out-of-band watchdog set commands can still be sent via the raw
|
||||
* command interface but this is a very dangerous thing to do since
|
||||
* a periodic "poke"/reset over a network is unreliable. This is
|
||||
* not a recommended way to use the IPMI watchdog commands.
|
||||
*/
|
||||
|
||||
msg_data[0] = IPM_WATCHDOG_SMS_OS;
|
||||
msg_data[1] = IPM_WATCHDOG_NO_ACTION;
|
||||
msg_data[2] = 0x00; /* pretimeout interval */
|
||||
msg_data[3] = IPM_WATCHDOG_CLEAR_SMS_OS;
|
||||
msg_data[4] = 0xb8; /* countdown lsb (100 ms/count) */
|
||||
msg_data[5] = 0x0b; /* countdown msb - 5 mins */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Watchdog Timer Shutoff command failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Watchdog Timer Shutoff command failed! %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Watchdog Timer Shutoff successful -- timer stopped\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_mc_rst_watchdog
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
static int
|
||||
ipmi_mc_rst_watchdog(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = BMC_RESET_WATCHDOG_TIMER;
|
||||
req.msg.data_len = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Reset Watchdog Timer command failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Reset Watchdog Timer command failed: %s",
|
||||
(rsp->ccode == IPM_WATCHDOG_RESET_ERROR) ?
|
||||
"Attempt to reset unitialized watchdog" :
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("IPMI Watchdog Timer Reset - countdown restarted!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ipmi_mc_main - top-level handler for MC functions
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
@ -539,12 +802,24 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
|
||||
if (argc < 1) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
printf_mc_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
else if (strncmp(argv[0], "help", 4) == 0) {
|
||||
printf_mc_usage();
|
||||
rc = 0;
|
||||
}
|
||||
else if (strncmp(argv[0], "reset", 5) == 0) {
|
||||
if (argc < 2 || strncmp(argv[1], "help", 4) == 0) {
|
||||
lprintf(LOG_ERR, "reset commands: warm, cold");
|
||||
if (argc < 2) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
printf_mc_reset_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
else if (strncmp(argv[1], "help", 4) == 0) {
|
||||
printf_mc_reset_usage();
|
||||
rc = 0;
|
||||
}
|
||||
else if (strncmp(argv[1], "cold", 4) == 0) {
|
||||
rc = ipmi_mc_reset(intf, BMC_COLD_RESET);
|
||||
@ -553,7 +828,9 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
rc = ipmi_mc_reset(intf, BMC_WARM_RESET);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "reset commands: warm, cold");
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc %s command: %s", argv[0], argv[1]);
|
||||
printf_mc_reset_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "info", 4) == 0) {
|
||||
@ -568,9 +845,268 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
else if (strncmp(argv[0], "setenables", 10) == 0) {
|
||||
rc = ipmi_mc_set_enables(intf, argc-1, &(argv[1]));
|
||||
}
|
||||
else if (!strncmp(argv[0], "selftest", 8)) {
|
||||
else if (!strncmp(argv[0], "selftest", 8)) {
|
||||
rc = ipmi_mc_get_selftest(intf);
|
||||
}
|
||||
|
||||
else if (!strncmp(argv[0], "watchdog", 8)) {
|
||||
if (argc < 2) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
print_watchdog_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
else if (strncmp(argv[1], "help", 4) == 0) {
|
||||
print_watchdog_usage();
|
||||
rc = 0;
|
||||
}
|
||||
else if (strncmp(argv[1], "get", 3) == 0) {
|
||||
rc = ipmi_mc_get_watchdog(intf);
|
||||
}
|
||||
else if(strncmp(argv[1], "off", 3) == 0) {
|
||||
rc = ipmi_mc_shutoff_watchdog(intf);
|
||||
}
|
||||
else if(strncmp(argv[1], "reset", 5) == 0) {
|
||||
rc = ipmi_mc_rst_watchdog(intf);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc %s command: %s", argv[0], argv[1]);
|
||||
print_watchdog_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "getsysinfo", 10) == 0) {
|
||||
rc = ipmi_sysinfo_main(intf, argc, argv, 0);
|
||||
}
|
||||
else if (strncmp(argv[0], "setsysinfo", 10) == 0) {
|
||||
rc = ipmi_sysinfo_main(intf, argc, argv, 1);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc command: %s", argv[0]);
|
||||
printf_mc_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* sysinfo_param() - function converts sysinfo param to int
|
||||
*
|
||||
* @str - user input string
|
||||
* @maxset - ?
|
||||
*
|
||||
* returns (-1) on error
|
||||
* returns > 0 on success
|
||||
*/
|
||||
static int
|
||||
sysinfo_param(const char *str, int *maxset)
|
||||
{
|
||||
if (!str || !maxset)
|
||||
return (-1);
|
||||
|
||||
*maxset = 4;
|
||||
if (!strcmp(str, "system_name"))
|
||||
return IPMI_SYSINFO_HOSTNAME;
|
||||
else if (!strcmp(str, "primary_os_name"))
|
||||
return IPMI_SYSINFO_PRIMARY_OS_NAME;
|
||||
else if (!strcmp(str, "os_name"))
|
||||
return IPMI_SYSINFO_OS_NAME;
|
||||
else if (!strcmp(str, "delloem_os_version"))
|
||||
return IPMI_SYSINFO_DELL_OS_VERSION;
|
||||
else if (!strcmp(str, "delloem_url")) {
|
||||
*maxset = 2;
|
||||
return IPMI_SYSINFO_DELL_URL;
|
||||
}
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_mc_getsysinfo() - function processes the IPMI Get System Info command
|
||||
*
|
||||
* @intf - ipmi interface
|
||||
* @param - parameter eg. 0xC0..0xFF = OEM
|
||||
* @block - number of block parameters
|
||||
* @set - number of set parameters
|
||||
* @len - length of buffer
|
||||
* @buffer - pointer to buffer
|
||||
*
|
||||
* returns (-1) on failure
|
||||
* returns 0 on success
|
||||
* returns > 0 IPMI code
|
||||
*/
|
||||
int
|
||||
ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
|
||||
int len, void *buffer)
|
||||
{
|
||||
uint8_t data[4];
|
||||
struct ipmi_rs *rsp = NULL;
|
||||
struct ipmi_rq req = {0};
|
||||
|
||||
memset(buffer, 0, len);
|
||||
memset(data, 0, 4);
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.lun = 0;
|
||||
req.msg.cmd = IPMI_GET_SYS_INFO;
|
||||
req.msg.data_len = 4;
|
||||
req.msg.data = data;
|
||||
|
||||
if (verbose > 1)
|
||||
printf("getsysinfo: %.2x/%.2x/%.2x\n", param, block, set);
|
||||
|
||||
data[0] = 0; /* get/set */
|
||||
data[1] = param;
|
||||
data[2] = block;
|
||||
data[3] = set;
|
||||
|
||||
/*
|
||||
* Format of get output is:
|
||||
* u8 param_rev
|
||||
* u8 selector
|
||||
* u8 encoding bit[0-3];
|
||||
* u8 length
|
||||
* u8 data0[14]
|
||||
*/
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
return (-1);
|
||||
|
||||
if (rsp->ccode == 0) {
|
||||
if (len > rsp->data_len)
|
||||
len = rsp->data_len;
|
||||
if (len && buffer)
|
||||
memcpy(buffer, rsp->data, len);
|
||||
}
|
||||
return rsp->ccode;
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_mc_setsysinfo() - function processes the IPMI Set System Info command
|
||||
*
|
||||
* @intf - ipmi interface
|
||||
* @len - length of buffer
|
||||
* @buffer - pointer to buffer
|
||||
*
|
||||
* returns (-1) on failure
|
||||
* returns 0 on success
|
||||
* returns > 0 IPMI code
|
||||
*/
|
||||
int
|
||||
ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer)
|
||||
{
|
||||
struct ipmi_rs *rsp = NULL;
|
||||
struct ipmi_rq req = {0};
|
||||
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.lun = 0;
|
||||
req.msg.cmd = IPMI_SET_SYS_INFO;
|
||||
req.msg.data_len = len;
|
||||
req.msg.data = buffer;
|
||||
|
||||
/*
|
||||
* Format of set input:
|
||||
* u8 param rev
|
||||
* u8 selector
|
||||
* u8 data1[16]
|
||||
*/
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp != NULL) {
|
||||
return rsp->ccode;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_sysinfo_main(struct ipmi_intf *intf, int argc, char ** argv, int is_set)
|
||||
{
|
||||
char *str;
|
||||
unsigned char infostr[256];
|
||||
unsigned char paramdata[18];
|
||||
int len, maxset, param, pos, rc, set;
|
||||
|
||||
if (argc == 2 && strcmp(argv[1], "help") == 0) {
|
||||
printf_sysinfo_usage(1);
|
||||
return 0;
|
||||
}
|
||||
else if (argc < 2 || (is_set == 1 && argc < 3)) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
printf_sysinfo_usage(1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Get Parameters */
|
||||
if ((param = sysinfo_param(argv[1], &maxset)) < 0) {
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc %s command: %s", argv[0], argv[1]);
|
||||
printf_sysinfo_usage(1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
if (is_set != 0) {
|
||||
str = argv[2];
|
||||
set = pos = 0;
|
||||
len = strlen(str);
|
||||
|
||||
/* first block holds 14 bytes, all others hold 16 */
|
||||
if ((len + 2 + 15) / 16 >= maxset)
|
||||
len = (maxset * 16) - 2;
|
||||
|
||||
do {
|
||||
memset(paramdata, 0, sizeof(paramdata));
|
||||
paramdata[0] = param;
|
||||
paramdata[1] = set;
|
||||
if (set == 0) {
|
||||
/* First block is special case */
|
||||
paramdata[2] = 0; /* ascii encoding */
|
||||
paramdata[3] = len; /* length */
|
||||
strncpy(paramdata + 4, str + pos, IPMI_SYSINFO_SET0_SIZE);
|
||||
pos += IPMI_SYSINFO_SET0_SIZE;
|
||||
}
|
||||
else {
|
||||
strncpy(paramdata + 2, str + pos, IPMI_SYSINFO_SETN_SIZE);
|
||||
pos += IPMI_SYSINFO_SETN_SIZE;
|
||||
}
|
||||
rc = ipmi_mc_setsysinfo(intf, 18, paramdata);
|
||||
|
||||
if (rc)
|
||||
break;
|
||||
|
||||
set++;
|
||||
} while (pos < len);
|
||||
}
|
||||
else {
|
||||
memset(infostr, 0, sizeof(infostr));
|
||||
/* Read blocks of data */
|
||||
pos = 0;
|
||||
for (set = 0; set < maxset; set++) {
|
||||
rc = ipmi_mc_getsysinfo(intf, param, set, 0, 18, paramdata);
|
||||
|
||||
if (rc)
|
||||
break;
|
||||
|
||||
if (set == 0) {
|
||||
/* First block is special case */
|
||||
if ((paramdata[2] & 0xF) == 0) {
|
||||
/* Determine max number of blocks to read */
|
||||
maxset = ((paramdata[3] + 2) + 15) / 16;
|
||||
}
|
||||
memcpy(infostr + pos, paramdata + 4, IPMI_SYSINFO_SET0_SIZE);
|
||||
pos += IPMI_SYSINFO_SET0_SIZE;
|
||||
}
|
||||
else {
|
||||
memcpy(infostr + pos, paramdata + 2, IPMI_SYSINFO_SETN_SIZE);
|
||||
pos += IPMI_SYSINFO_SETN_SIZE;
|
||||
}
|
||||
}
|
||||
printf("%s\n", infostr);
|
||||
}
|
||||
if (rc < 0) {
|
||||
lprintf(LOG_ERR, "%s %s set %d command failed", argv[0], argv[1], set);
|
||||
}
|
||||
else if (rc == 0x80) {
|
||||
lprintf(LOG_ERR, "%s %s parameter not supported", argv[0], argv[1]);
|
||||
}
|
||||
else if (rc > 0) {
|
||||
lprintf(LOG_ERR, "%s command failed: %s", argv[0],
|
||||
val2str(rc, completion_code_vals));
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
@ -26,10 +26,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -39,8 +35,10 @@
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_sel.h>
|
||||
|
||||
static int ipmi_oem_supermicro(struct ipmi_intf * intf);
|
||||
static int ipmi_oem_ibm(struct ipmi_intf * intf);
|
||||
|
||||
static struct ipmi_oem_handle ipmi_oem_list[] = {
|
||||
{
|
||||
@ -60,7 +58,16 @@ static struct ipmi_oem_handle ipmi_oem_list[] = {
|
||||
name: "icts",
|
||||
desc: "IPMI 2.0 ICTS compliance support",
|
||||
},
|
||||
{ 0 },
|
||||
{
|
||||
name: "ibm",
|
||||
desc: "IBM OEM support",
|
||||
setup: ipmi_oem_ibm,
|
||||
},
|
||||
{
|
||||
name: "i82571spt",
|
||||
desc: "Intel 82571 MAC with integrated RMCP+ support in super pass-through mode",
|
||||
},
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
/* Supermicro IPMIv2 BMCs use OEM authtype */
|
||||
@ -71,6 +78,17 @@ ipmi_oem_supermicro(struct ipmi_intf * intf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_oem_ibm(struct ipmi_intf * intf)
|
||||
{
|
||||
char * filename;
|
||||
if ((filename = getenv("IPMI_OEM_IBM_DATAFILE")) == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to read IPMI_OEM_IBM_DATAFILE from environment");
|
||||
return -1;
|
||||
}
|
||||
return ipmi_sel_oem_init((const char *)filename);
|
||||
}
|
||||
|
||||
/* ipmi_oem_print - print list of OEM handles
|
||||
*/
|
||||
void
|
||||
@ -96,28 +114,22 @@ int
|
||||
ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
|
||||
{
|
||||
struct ipmi_oem_handle * oem;
|
||||
int i;
|
||||
int rc = 0;
|
||||
|
||||
if (strncmp(oemtype, "help", 4) == 0 ||
|
||||
strncmp(oemtype, "list", 4) == 0 ||
|
||||
oemtype == NULL) {
|
||||
if (oemtype == NULL ||
|
||||
strncmp(oemtype, "help", 4) == 0 ||
|
||||
strncmp(oemtype, "list", 4) == 0) {
|
||||
ipmi_oem_print();
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (oem=ipmi_oem_list, i=0; i < sizeof(ipmi_oem_list)/sizeof(struct ipmi_oem_handle); oem++, i++) {
|
||||
if (oem->name == NULL)
|
||||
continue;
|
||||
for (oem=ipmi_oem_list; oem->name != NULL; oem++) {
|
||||
if (strncmp(oemtype, oem->name, strlen(oem->name)) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (oem->name == NULL) {
|
||||
/* nothing was found */
|
||||
lprintf(LOG_ERR, "OEM support not found for \"%s\"", oemtype);
|
||||
if (oem->name == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* save pointer for later use */
|
||||
intf->oem = oem;
|
||||
@ -150,4 +162,3 @@ ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -28,16 +28,13 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
@ -193,15 +190,17 @@ ipmi_pef_msg_exchange(struct ipmi_intf * intf, struct ipmi_rq * req, char * txt)
|
||||
// common IPMItool rqst/resp handling
|
||||
*/
|
||||
struct ipmi_rs * rsp = intf->sendrecv(intf, req);
|
||||
if (!rsp)
|
||||
if (!rsp) {
|
||||
return(NULL);
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, " **Error %x in '%s' command",
|
||||
rsp ? rsp->ccode : 0, txt);
|
||||
} else if (rsp->ccode == 0x80) {
|
||||
return(NULL); /* Do not output error, just unsupported parameters */
|
||||
} else if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, " **Error %x in '%s' command", rsp->ccode, txt);
|
||||
return(NULL);
|
||||
}
|
||||
if (verbose > 2)
|
||||
if (verbose > 2) {
|
||||
printbuf(rsp->data, rsp->data_len, txt);
|
||||
}
|
||||
return(rsp);
|
||||
}
|
||||
|
||||
@ -311,7 +310,7 @@ ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
|
||||
"PET community");
|
||||
else {
|
||||
rsp->data[19] = '\0';
|
||||
ipmi_pef_print_str("PET Community", &rsp->data[1]);
|
||||
ipmi_pef_print_str("PET Community", (const char *)&rsp->data[1]);
|
||||
}
|
||||
}
|
||||
ipmi_pef_print_dec("ACK timeout/retry (secs)", timeout);
|
||||
@ -564,7 +563,11 @@ ipmi_pef_print_event_info(struct pef_cfgparm_filter_table_entry * pef, char * bu
|
||||
p = strchr(buf, '\0');
|
||||
for (i=0; i<PEF_B2S_GENERIC_ER_ENTRIES; i++) {
|
||||
if (offmask & 1) {
|
||||
sprintf(p, ",%s", ipmi_pef_bit_desc(pef_b2s_generic_ER[t-1], i));
|
||||
if ((t-1) >= PEF_B2S_GENERIC_ER_ENTRIES) {
|
||||
sprintf(p, ", Unrecognized event trigger");
|
||||
} else {
|
||||
sprintf(p, ",%s", ipmi_pef_bit_desc(pef_b2s_generic_ER[t-1], i));
|
||||
}
|
||||
p = strchr(p, '\0');
|
||||
}
|
||||
offmask >>= 1;
|
||||
@ -664,13 +667,19 @@ ipmi_pef_list_policies(struct ipmi_intf * intf)
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl, * ptmp;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl = NULL;
|
||||
struct pef_cfgparm_policy_table_entry * ptmp = NULL;
|
||||
uint32_t i;
|
||||
uint8_t wrk, ch, medium, tbl_size;
|
||||
|
||||
tbl_size = ipmi_pef_get_policy_table(intf, &ptbl);
|
||||
if (!tbl_size)
|
||||
if (!tbl_size) {
|
||||
if (!ptbl) {
|
||||
free(ptbl);
|
||||
ptbl = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = IPMI_CMD_GET_CHANNEL_INFO;
|
||||
@ -723,6 +732,7 @@ ipmi_pef_list_policies(struct ipmi_intf * intf)
|
||||
}
|
||||
}
|
||||
free(ptbl);
|
||||
ptbl = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -734,6 +744,7 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
|
||||
struct ipmi_rq req;
|
||||
struct pef_cfgparm_selector psel;
|
||||
char tbuf[40];
|
||||
uint32_t timei;
|
||||
time_t ts;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
@ -745,12 +756,13 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
|
||||
"Last S/W processed ID");
|
||||
return;
|
||||
}
|
||||
memcpy(&timei, rsp->data, sizeof(timei));
|
||||
#if WORDS_BIGENDIAN
|
||||
ts = (time_t)(rsp->data[0]<<24 + rsp->data[1]<<16 + rsp->data[2]<<8 + rsp->data[3]);
|
||||
#else
|
||||
ts = (time_t)(*(long *)rsp->data);
|
||||
timei = BSWAP_32(timei);
|
||||
#endif
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&ts));
|
||||
ts = (time_t)timei;
|
||||
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", gmtime(&ts));
|
||||
|
||||
ipmi_pef_print_str("Last SEL addition", tbuf);
|
||||
ipmi_pef_print_2xd("Last SEL record ID", rsp->data[5], rsp->data[4]);
|
||||
@ -791,12 +803,15 @@ ipmi_pef_get_info(struct ipmi_intf * intf)
|
||||
struct ipmi_rq req;
|
||||
struct pef_capabilities * pcap;
|
||||
struct pef_cfgparm_selector psel;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl = NULL;
|
||||
uint8_t * uid;
|
||||
uint8_t actions, tbl_size;
|
||||
|
||||
if ((tbl_size = ipmi_pef_get_policy_table(intf, &ptbl)) > 0)
|
||||
tbl_size = ipmi_pef_get_policy_table(intf, &ptbl);
|
||||
if (!ptbl) {
|
||||
free(ptbl);
|
||||
ptbl = NULL;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
@ -805,6 +820,7 @@ ipmi_pef_get_info(struct ipmi_intf * intf)
|
||||
if (!rsp)
|
||||
return;
|
||||
pcap = (struct pef_capabilities *)rsp->data;
|
||||
|
||||
ipmi_pef_print_1xd("Version", pcap->version);
|
||||
ipmi_pef_print_dec("PEF table size", pcap->tblsize);
|
||||
ipmi_pef_print_dec("Alert policy table size", tbl_size);
|
||||
@ -847,6 +863,7 @@ int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
// PEF subcommand handling
|
||||
*/
|
||||
int help = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (!argc || !strncmp(argv[0], "info", 4))
|
||||
ipmi_pef_get_info(intf);
|
||||
@ -860,11 +877,14 @@ int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
ipmi_pef_list_entries(intf);
|
||||
else {
|
||||
help = 1;
|
||||
rc = -1;
|
||||
lprintf(LOG_ERR, "Invalid PEF command: '%s'\n", argv[0]);
|
||||
}
|
||||
|
||||
if (help)
|
||||
lprintf(LOG_NOTICE, "PEF commands: info status policy list");
|
||||
else if (!verbose)
|
||||
printf("\n");
|
||||
return 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -43,9 +39,13 @@
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_raw.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
|
||||
#define IPMI_I2C_MASTER_MAX_SIZE 0x40
|
||||
#define IPMI_I2C_MASTER_MAX_SIZE 0x40 /* 64 bytes */
|
||||
|
||||
static int is_valid_param(const char *input_param, uint8_t *uchr_ptr,
|
||||
const char *label);
|
||||
|
||||
/* ipmi_master_write_read - Perform I2C write/read transactions
|
||||
*
|
||||
@ -53,6 +53,7 @@
|
||||
* IPMI interface. It has a maximum transfer size of 32 bytes.
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @bus: channel number, i2c bus id and type
|
||||
* @addr: i2c slave address
|
||||
* @wdata: data to write
|
||||
* @wsize: length of data to write (max 64 bytes)
|
||||
@ -61,7 +62,8 @@
|
||||
* Returns pointer to IPMI Response
|
||||
*/
|
||||
struct ipmi_rs *
|
||||
ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, uint8_t wsize, uint8_t rsize)
|
||||
ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
|
||||
uint8_t * wdata, uint8_t wsize, uint8_t rsize)
|
||||
{
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_rs * rsp;
|
||||
@ -83,7 +85,7 @@ ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, u
|
||||
req.msg.data_len = 3;
|
||||
|
||||
memset(rqdata, 0, IPMI_I2C_MASTER_MAX_SIZE + 3);
|
||||
rqdata[0] = 0x00; /* channel number, bus id, bus type */
|
||||
rqdata[0] = bus; /* channel number, bus id, bus type */
|
||||
rqdata[1] = addr; /* slave address */
|
||||
rqdata[2] = rsize; /* number of bytes to read */
|
||||
|
||||
@ -128,9 +130,64 @@ ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, u
|
||||
return rsp;
|
||||
}
|
||||
|
||||
#define RAW_SPD_SIZE 256
|
||||
|
||||
int
|
||||
ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
uint8_t msize = IPMI_I2C_MASTER_MAX_SIZE; /* allow to override default */
|
||||
uint8_t channel = 0;
|
||||
uint8_t i2cbus = 0;
|
||||
uint8_t i2caddr = 0;
|
||||
uint8_t spd_data[RAW_SPD_SIZE];
|
||||
int i;
|
||||
|
||||
memset(spd_data, 0, RAW_SPD_SIZE);
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "usage: spd <i2cbus> <i2caddr> [channel] [maxread]");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_valid_param(argv[0], &i2cbus, "i2cbus") != 0)
|
||||
return (-1);
|
||||
|
||||
if (is_valid_param(argv[1], &i2caddr, "i2caddr") != 0)
|
||||
return (-1);
|
||||
|
||||
if (argc >= 3) {
|
||||
if (is_valid_param(argv[2], &channel, "channel") != 0)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (argc >= 4) {
|
||||
if (is_valid_param(argv[3], &msize, "maxread") != 0)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
i2cbus = ((channel & 0xF) << 4) | ((i2cbus & 7) << 1) | 1;
|
||||
|
||||
for (i = 0; i < RAW_SPD_SIZE; i+= msize) {
|
||||
rsp = ipmi_master_write_read(intf, i2cbus, i2caddr,
|
||||
(uint8_t *)&i, 1, msize );
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(spd_data+i, rsp->data, msize);
|
||||
}
|
||||
|
||||
ipmi_spd_print(spd_data, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rawi2c_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "usage: i2c <i2caddr> <read bytes> [write data]");
|
||||
lprintf(LOG_NOTICE, "usage: i2c [bus=public|# [chan=#] <i2caddr> <read bytes> [write data]");
|
||||
lprintf(LOG_NOTICE, " bus=public is default");
|
||||
lprintf(LOG_NOTICE, " chan=0 is default, bus= must be specified to use chan=");
|
||||
}
|
||||
|
||||
int
|
||||
@ -141,20 +198,44 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
uint8_t i2caddr = 0;
|
||||
uint8_t rsize = 0;
|
||||
uint8_t wsize = 0;
|
||||
int i;
|
||||
unsigned int rbus = 0;
|
||||
uint8_t bus = 0;
|
||||
int i = 0;
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
/* handle bus= argument */
|
||||
if (argc > 2 && strncmp(argv[0], "bus=", 4) == 0) {
|
||||
i = 1;
|
||||
if (strncmp(argv[0], "bus=public", 10) == 0)
|
||||
bus = 0;
|
||||
else if (sscanf(argv[0], "bus=%u", &rbus) == 1)
|
||||
bus = ((rbus & 7) << 1) | 1;
|
||||
else
|
||||
bus = 0;
|
||||
|
||||
/* handle channel= argument
|
||||
* the bus= argument must be supplied first on command line */
|
||||
if (argc > 3 && strncmp(argv[1], "chan=", 5) == 0) {
|
||||
i = 2;
|
||||
if (sscanf(argv[1], "chan=%u", &rbus) == 1)
|
||||
bus |= rbus << 4;
|
||||
}
|
||||
}
|
||||
|
||||
if ((argc-i) < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
rawi2c_usage();
|
||||
return 0;
|
||||
}
|
||||
else if (argc-2 > IPMI_I2C_MASTER_MAX_SIZE) {
|
||||
else if (argc-i-2 > IPMI_I2C_MASTER_MAX_SIZE) {
|
||||
lprintf(LOG_ERR, "Raw command input limit (%d bytes) exceeded",
|
||||
IPMI_I2C_MASTER_MAX_SIZE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
i2caddr = (uint8_t)strtoul(argv[0], NULL, 0);
|
||||
rsize = (uint8_t)strtoul(argv[1], NULL, 0);
|
||||
if (is_valid_param(argv[i++], &i2caddr, "i2caddr") != 0)
|
||||
return (-1);
|
||||
|
||||
if (is_valid_param(argv[i++], &rsize, "read size") != 0)
|
||||
return (-1);
|
||||
|
||||
if (i2caddr == 0) {
|
||||
lprintf(LOG_ERR, "Invalid I2C address 0");
|
||||
@ -163,9 +244,13 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
|
||||
memset(wdata, 0, IPMI_I2C_MASTER_MAX_SIZE);
|
||||
for (i=2; i<argc; i++) {
|
||||
uint8_t val = (uint8_t)strtol(argv[i], NULL, 0);
|
||||
wdata[i-2] = val;
|
||||
for (; i < argc; i++) {
|
||||
uint8_t val = 0;
|
||||
|
||||
if (is_valid_param(argv[i], &val, "parameter") != 0)
|
||||
return (-1);
|
||||
|
||||
wdata[wsize] = val;
|
||||
wsize++;
|
||||
}
|
||||
|
||||
@ -173,7 +258,7 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
i2caddr, rsize, wsize);
|
||||
printbuf(wdata, wsize, "WRITE DATA");
|
||||
|
||||
rsp = ipmi_master_write_read(intf, i2caddr, wdata, wsize, rsize);
|
||||
rsp = ipmi_master_write_read(intf, bus, i2caddr, wdata, wsize, rsize);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
return -1;
|
||||
@ -188,6 +273,9 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (verbose || wsize == 0)
|
||||
printf("Read %d bytes from I2C device %02Xh\n", rsp->data_len, i2caddr);
|
||||
|
||||
if (rsp->data_len < rsize)
|
||||
return -1;
|
||||
|
||||
/* print the raw response buffer */
|
||||
for (i=0; i<rsp->data_len; i++) {
|
||||
if (((i%16) == 0) && (i != 0))
|
||||
@ -212,22 +300,36 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ipmi_raw_help() - print 'raw' help text
|
||||
*
|
||||
* returns void
|
||||
*/
|
||||
void
|
||||
ipmi_raw_help()
|
||||
{
|
||||
lprintf(LOG_NOTICE, "RAW Commands: raw <netfn> <cmd> [data]");
|
||||
print_valstr(ipmi_netfn_vals, "Network Function Codes", LOG_NOTICE);
|
||||
lprintf(LOG_NOTICE, "(can also use raw hex values)");
|
||||
} /* ipmi_raw_help() */
|
||||
|
||||
int
|
||||
ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t netfn, cmd, lun;
|
||||
uint16_t netfn_tmp = 0;
|
||||
int i;
|
||||
unsigned long ufn;
|
||||
|
||||
uint8_t data[256];
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "RAW Commands: raw <netfn> <cmd> [data]");
|
||||
print_valstr(ipmi_netfn_vals, "Network Function Codes", LOG_NOTICE);
|
||||
lprintf(LOG_NOTICE, "(can also use raw hex values)");
|
||||
return -1;
|
||||
if (argc == 1 && strncmp(argv[0], "help", 4) == 0) {
|
||||
ipmi_raw_help();
|
||||
return 0;
|
||||
}
|
||||
else if (argc < 2) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
ipmi_raw_help();
|
||||
return (-1);
|
||||
}
|
||||
else if (argc > sizeof(data))
|
||||
{
|
||||
@ -239,22 +341,34 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
ipmi_intf_session_set_retry(intf, 1);
|
||||
|
||||
lun = intf->target_lun;
|
||||
netfn = str2val(argv[0], ipmi_netfn_vals);
|
||||
if (netfn == 0xff) {
|
||||
netfn = (uint8_t)strtol(argv[0], NULL, 0);
|
||||
netfn_tmp = str2val(argv[0], ipmi_netfn_vals);
|
||||
if (netfn_tmp == 0xff) {
|
||||
if (is_valid_param(argv[0], &netfn, "netfn") != 0)
|
||||
return (-1);
|
||||
} else {
|
||||
if (netfn_tmp >= UINT8_MAX) {
|
||||
lprintf(LOG_ERR, "Given netfn \"%s\" is out of range.", argv[0]);
|
||||
return (-1);
|
||||
}
|
||||
netfn = netfn_tmp;
|
||||
}
|
||||
|
||||
cmd = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
if (is_valid_param(argv[1], &cmd, "command") != 0)
|
||||
return (-1);
|
||||
|
||||
memset(data, 0, sizeof(data));
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = netfn;
|
||||
req.msg.lun = lun;
|
||||
req.msg.lun = lun;
|
||||
req.msg.cmd = cmd;
|
||||
req.msg.data = data;
|
||||
|
||||
for (i=2; i<argc; i++) {
|
||||
uint8_t val = (uint8_t)strtol(argv[i], NULL, 0);
|
||||
uint8_t val = 0;
|
||||
|
||||
if (is_valid_param(argv[i], &val, "data") != 0)
|
||||
return (-1);
|
||||
|
||||
req.msg.data[i-2] = val;
|
||||
req.msg.data_len++;
|
||||
}
|
||||
@ -295,3 +409,24 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* is_valid_param -
|
||||
*
|
||||
* @input_param: string to convert from
|
||||
* @uchr_ptr: pointer where to store converted value
|
||||
* @label: string used in error message
|
||||
*
|
||||
* returns 0 if parameter is valid
|
||||
* returns (-1) if parameter is invalid/on error
|
||||
*/
|
||||
int
|
||||
is_valid_param(const char *input_param, uint8_t *uchr_ptr, const char *label) {
|
||||
if (input_param == NULL || label == NULL) {
|
||||
lprintf(LOG_ERROR, "ERROR: NULL pointer passed.");
|
||||
return (-1);
|
||||
}
|
||||
if (str2uchar(input_param, uchr_ptr) == 0)
|
||||
return 0;
|
||||
|
||||
lprintf(LOG_ERR, "Given %s \"%s\" is invalid.", label, input_param);
|
||||
return (-1);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
668
ipmitool/lib/ipmi_sdradd.c
Normal file
668
ipmitool/lib/ipmi_sdradd.c
Normal file
@ -0,0 +1,668 @@
|
||||
/*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Functions to program the SDR repository, from built-in sensors or
|
||||
* from sensors dumped in a binary file.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_mc.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
|
||||
#define ADD_PARTIAL_SDR 0x25
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_add_rq {
|
||||
uint16_t reserve_id; /* reservation ID */
|
||||
uint16_t id; /* record ID */
|
||||
uint8_t offset; /* offset into SDR */
|
||||
uint8_t in_progress; /* 0=partial, 1=last */
|
||||
#define PARTIAL_ADD (0)
|
||||
#define LAST_RECORD (1)
|
||||
uint8_t data[1]; /* SDR record data */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* This was formerly initialized to 24, reduced this to 19 so the overall
|
||||
message fits into the recommended 32-byte limit */
|
||||
static int sdr_max_write_len = 19;
|
||||
int ipmi_parse_range_list(const char *rangeList, unsigned char *pHexList);
|
||||
int ipmi_hex_to_dec( char * rangeList, unsigned char * pDecValue);
|
||||
|
||||
static int
|
||||
partial_send(struct ipmi_intf *intf, struct ipmi_rq *req, uint16_t *id)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
rsp = intf->sendrecv(intf, req);
|
||||
if (rsp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode || rsp->data_len < 2) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*id = rsp->data[0] + (rsp->data[1] << 8);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_sdr_add_record(struct ipmi_intf *intf, struct sdr_record_list *sdrr)
|
||||
{
|
||||
struct ipmi_rq req;
|
||||
struct sdr_add_rq *sdr_rq;
|
||||
uint16_t reserve_id;
|
||||
uint16_t id;
|
||||
int i;
|
||||
int len = sdrr->length;
|
||||
int rc = 0;
|
||||
|
||||
/* actually no SDR to program */
|
||||
if (len < 1 || !sdrr->raw) {
|
||||
lprintf(LOG_ERR, "ipmitool: bad record , skipped");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ipmi_sdr_get_reservation(intf, 0, &reserve_id)) {
|
||||
lprintf(LOG_ERR, "ipmitool: reservation failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
sdr_rq = (struct sdr_add_rq *)malloc(sizeof(*sdr_rq) + sdr_max_write_len);
|
||||
if (sdr_rq == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
return -1;
|
||||
}
|
||||
sdr_rq->reserve_id = reserve_id;
|
||||
sdr_rq->in_progress = PARTIAL_ADD;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = ADD_PARTIAL_SDR;
|
||||
req.msg.data = (uint8_t *) sdr_rq;
|
||||
|
||||
/* header first */
|
||||
sdr_rq->id = 0;
|
||||
sdr_rq->offset = 0;
|
||||
sdr_rq->data[0] = sdrr->id & 0xFF;
|
||||
sdr_rq->data[1] = (sdrr->id >> 8) & 0xFF;
|
||||
sdr_rq->data[2] = sdrr->version;
|
||||
sdr_rq->data[3] = sdrr->type;
|
||||
sdr_rq->data[4] = sdrr->length;
|
||||
req.msg.data_len = 5 + sizeof(*sdr_rq) - 1;
|
||||
|
||||
if (partial_send(intf, &req, &id)) {
|
||||
lprintf(LOG_ERR, "ipmitool: partial send error");
|
||||
free(sdr_rq);
|
||||
sdr_rq = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
|
||||
/* sdr entry */
|
||||
while (i < len) {
|
||||
int data_len = 0;
|
||||
if ( (len - i) <= sdr_max_write_len) {
|
||||
/* last crunch */
|
||||
data_len = len - i;
|
||||
sdr_rq->in_progress = LAST_RECORD;
|
||||
} else {
|
||||
data_len = sdr_max_write_len;
|
||||
}
|
||||
|
||||
sdr_rq->id = id;
|
||||
sdr_rq->offset = i + 5;
|
||||
memcpy(sdr_rq->data, sdrr->raw + i, data_len);
|
||||
req.msg.data_len = data_len + sizeof(*sdr_rq) - 1;
|
||||
|
||||
if ((rc = partial_send(intf, &req, &id)) != 0) {
|
||||
lprintf(LOG_ERR, "ipmitool: partial add failed");
|
||||
break;
|
||||
}
|
||||
|
||||
i += data_len;
|
||||
}
|
||||
|
||||
free(sdr_rq);
|
||||
sdr_rq = NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_sdr_repo_clear(struct ipmi_intf *intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[8];
|
||||
uint16_t reserve_id;
|
||||
int try;
|
||||
|
||||
if (ipmi_sdr_get_reservation(intf, 0, &reserve_id))
|
||||
return -1;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = 0x27; // FIXME
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 6;
|
||||
|
||||
msg_data[0] = reserve_id & 0xFF;
|
||||
msg_data[1] = reserve_id >> 8;
|
||||
msg_data[2] = 'C';
|
||||
msg_data[3] = 'L';
|
||||
msg_data[4] = 'R';
|
||||
msg_data[5] = 0xAA;
|
||||
|
||||
for (try = 0; try < 5; try++) {
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to clear SDRR");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Unable to clear SDRR: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
if ((rsp->data[0] & 1) == 1) {
|
||||
printf("SDRR successfully erased\n");
|
||||
return 0;
|
||||
}
|
||||
printf("Wait for SDRR erasure completed...\n");
|
||||
msg_data[5] = 0;
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
/* if we are here we fed up trying erase */
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
struct sdrr_queue {
|
||||
struct sdr_record_list *head;
|
||||
struct sdr_record_list *tail;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Fill the SDR repository from built-in sensors
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Get all the SDR records stored in <queue>
|
||||
*/
|
||||
static int
|
||||
sdrr_get_records(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr,
|
||||
struct sdrr_queue *queue)
|
||||
{
|
||||
struct sdr_get_rs *header;
|
||||
|
||||
queue->head = NULL;
|
||||
queue->tail = NULL;
|
||||
|
||||
while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL) {
|
||||
struct sdr_record_list *sdrr;
|
||||
|
||||
sdrr = malloc(sizeof (struct sdr_record_list));
|
||||
if (sdrr == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
return -1;
|
||||
}
|
||||
memset(sdrr, 0, sizeof (struct sdr_record_list));
|
||||
|
||||
sdrr->id = header->id;
|
||||
sdrr->version = header->version;
|
||||
sdrr->type = header->type;
|
||||
sdrr->length = header->length;
|
||||
sdrr->raw = ipmi_sdr_get_record(intf, header, itr);
|
||||
(void)ipmi_sdr_print_name_from_rawentry(intf, sdrr->id, sdrr->type,sdrr->raw);
|
||||
|
||||
/* put in the record queue */
|
||||
if (queue->head == NULL)
|
||||
queue->head = sdrr;
|
||||
else
|
||||
queue->tail->next = sdrr;
|
||||
queue->tail = sdrr;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
sdr_copy_to_sdrr(struct ipmi_intf *intf, int use_builtin,
|
||||
int from_addr, int to_addr)
|
||||
{
|
||||
int rc;
|
||||
struct sdrr_queue sdrr_queue;
|
||||
struct ipmi_sdr_iterator *itr;
|
||||
struct sdr_record_list *sdrr;
|
||||
struct sdr_record_list *sdrr_next;
|
||||
|
||||
/* generate list of records for this target */
|
||||
intf->target_addr = from_addr;
|
||||
|
||||
/* initialize iterator */
|
||||
itr = ipmi_sdr_start(intf, use_builtin);
|
||||
if (itr == 0)
|
||||
return 0;
|
||||
|
||||
printf("Load SDRs from 0x%x\n", from_addr);
|
||||
rc = sdrr_get_records(intf, itr, &sdrr_queue);
|
||||
ipmi_sdr_end(intf, itr);
|
||||
/* ... */
|
||||
|
||||
/* write the SDRs to the destination SDR Repository */
|
||||
intf->target_addr = to_addr;
|
||||
for (sdrr = sdrr_queue.head; sdrr != NULL; sdrr = sdrr_next) {
|
||||
sdrr_next = sdrr->next;
|
||||
rc = ipmi_sdr_add_record(intf, sdrr);
|
||||
if(rc < 0){
|
||||
lprintf(LOG_ERR, "Cannot add SDR ID 0x%04x to repository...", sdrr->id);
|
||||
}
|
||||
free(sdrr);
|
||||
sdrr = NULL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_sensors(struct ipmi_intf *intf, int maxslot)
|
||||
{
|
||||
int i;
|
||||
int rc = 0;
|
||||
int slave_addr;
|
||||
int myaddr = intf->target_addr;
|
||||
|
||||
if (ipmi_sdr_repo_clear(intf)) {
|
||||
lprintf(LOG_ERR, "Cannot erase SDRR. Give up.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* First fill the SDRR from local built-in sensors */
|
||||
rc = sdr_copy_to_sdrr(intf, 1, myaddr, myaddr);
|
||||
|
||||
/* Now fill the SDRR with remote sensors */
|
||||
if( maxslot != 0 ) {
|
||||
for (i = 0, slave_addr = 0xB0; i < maxslot; i++, slave_addr += 2) {
|
||||
/* Hole in the PICMG 2.9 mapping */
|
||||
if (slave_addr == 0xC2) slave_addr += 2;
|
||||
if(sdr_copy_to_sdrr(intf, 0, slave_addr, myaddr) < 0)
|
||||
{
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int ipmi_hex_to_dec( char * strchar, unsigned char * pDecValue)
|
||||
{
|
||||
int rc = -1;
|
||||
unsigned char retValue = 0;
|
||||
|
||||
if(
|
||||
(strlen(strchar) == 4)
|
||||
&&
|
||||
(strchar[0] == '0')
|
||||
&&
|
||||
(strchar[1] == 'x')
|
||||
)
|
||||
{
|
||||
rc = 0;
|
||||
|
||||
if((strchar[2] >= '0') && (strchar[2] <= '9'))
|
||||
{
|
||||
retValue += ((strchar[2]-'0') * 16);
|
||||
}
|
||||
else if((strchar[2] >= 'a') && (strchar[2] <= 'f'))
|
||||
{
|
||||
retValue += (((strchar[2]-'a') + 10) * 16);
|
||||
}
|
||||
else if((strchar[2] >= 'A') && (strchar[2] <= 'F'))
|
||||
{
|
||||
retValue += (((strchar[2]-'A') + 10) * 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
if((strchar[3] >= '0') && (strchar[3] <= '9'))
|
||||
{
|
||||
retValue += ((strchar[3]-'0'));
|
||||
}
|
||||
else if((strchar[3] >= 'a') && (strchar[3] <= 'f'))
|
||||
{
|
||||
retValue += (((strchar[3]-'a') + 10));
|
||||
}
|
||||
else if((strchar[3] >= 'A') && (strchar[3] <= 'F'))
|
||||
{
|
||||
retValue += (((strchar[3]-'A') + 10));
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if(rc == 0)
|
||||
{
|
||||
* pDecValue = retValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Must be Hex value of 4 characters (Ex.: 0x24)");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define MAX_NUM_SLOT 128
|
||||
int ipmi_parse_range_list(const char *rangeList, unsigned char * pHexList)
|
||||
{
|
||||
int rc = -1;
|
||||
|
||||
unsigned char listOffset = 0;
|
||||
char * nextString;
|
||||
char * rangeString;
|
||||
char * inProcessString = (char *) rangeList;
|
||||
|
||||
/* Discard empty string */
|
||||
if(strlen(rangeList) == 0)
|
||||
{
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* First, cut to comma separated string */
|
||||
nextString = strstr( rangeList, "," );
|
||||
|
||||
if(nextString != rangeList)
|
||||
{
|
||||
unsigned char isLast;
|
||||
/* We get a valid string so far */
|
||||
rc = 0;
|
||||
|
||||
do
|
||||
{
|
||||
if(nextString != NULL)
|
||||
{
|
||||
(*nextString)= 0;
|
||||
nextString ++;
|
||||
isLast = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
isLast = 1;
|
||||
}
|
||||
|
||||
/* At this point, it is a single entry or a range */
|
||||
rangeString = strstr( inProcessString, "-" );
|
||||
if(rangeString == NULL)
|
||||
{
|
||||
unsigned char decValue = 0;
|
||||
|
||||
/* Single entry */
|
||||
rc = ipmi_hex_to_dec( inProcessString, &decValue);
|
||||
|
||||
if(rc == 0)
|
||||
{
|
||||
if((decValue % 2) == 0)
|
||||
{
|
||||
pHexList[listOffset++] = decValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "I2C address provided value must be even.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char startValue = 0;
|
||||
unsigned char endValue = 0;
|
||||
|
||||
|
||||
(*rangeString)= 0; /* Cut string*/
|
||||
rangeString ++;
|
||||
|
||||
/* Range */
|
||||
rc = ipmi_hex_to_dec( inProcessString, &startValue);
|
||||
if(rc == 0)
|
||||
rc = ipmi_hex_to_dec( rangeString, &endValue);
|
||||
|
||||
if(rc == 0)
|
||||
{
|
||||
if(((startValue % 2) == 0) && ((endValue % 2) == 0))
|
||||
{
|
||||
do
|
||||
{
|
||||
pHexList[listOffset++] = startValue;
|
||||
startValue += 2;
|
||||
}
|
||||
while(startValue != endValue);
|
||||
pHexList[listOffset++] = endValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "I2C address provided value must be even.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isLast == 0)
|
||||
{
|
||||
/* Setup for next string */
|
||||
inProcessString = nextString;
|
||||
nextString = strstr( rangeList, "," );
|
||||
}
|
||||
}while ((isLast == 0) && (rc == 0));
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_list(struct ipmi_intf *intf, const char *rangeList)
|
||||
{
|
||||
int i;
|
||||
int rc = 0;
|
||||
int slave_addr;
|
||||
int myaddr = intf->target_addr;
|
||||
unsigned char listValue[MAX_NUM_SLOT];
|
||||
|
||||
memset( listValue, 0, MAX_NUM_SLOT );
|
||||
|
||||
/* Build list from string */
|
||||
if(ipmi_parse_range_list(rangeList, listValue) != 0)
|
||||
{
|
||||
lprintf(LOG_ERR, "Range - List invalid, cannot be parsed.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
unsigned char counter = 0;
|
||||
printf("List to scan: (Built-in) ");
|
||||
while(listValue[counter] != 0)
|
||||
{
|
||||
printf("%02x ", listValue[counter]);
|
||||
counter++;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
printf("Clearing SDR Repository\n");
|
||||
if (ipmi_sdr_repo_clear(intf)) {
|
||||
lprintf(LOG_ERR, "Cannot erase SDRR. Give up.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* First fill the SDRR from local built-in sensors */
|
||||
printf("Sanning built-in sensors..\n");
|
||||
rc = sdr_copy_to_sdrr(intf, 1, myaddr, myaddr);
|
||||
|
||||
/* Now fill the SDRR with provided sensors list */
|
||||
{
|
||||
unsigned char counter = 0;
|
||||
while((rc == 0) && (listValue[counter] != 0))
|
||||
{
|
||||
slave_addr = listValue[counter];
|
||||
printf("Scanning %02Xh..\n", slave_addr);
|
||||
if(sdr_copy_to_sdrr(intf, 0, slave_addr, myaddr) < 0)
|
||||
{
|
||||
rc = -1;
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Fill the SDR repository from records stored in a binary file
|
||||
*
|
||||
*/
|
||||
|
||||
static int
|
||||
ipmi_sdr_read_records(const char *filename, struct sdrr_queue *queue)
|
||||
{
|
||||
struct sdr_get_rs header;
|
||||
int rc = 0;
|
||||
int fd;
|
||||
uint8_t binHdr[5];
|
||||
|
||||
queue->head = NULL;
|
||||
queue->tail = NULL;
|
||||
|
||||
if ((fd = open(filename, O_RDONLY)) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (read(fd, binHdr, 5) == 5) {
|
||||
|
||||
struct sdr_record_list *sdrr;
|
||||
|
||||
lprintf(LOG_DEBUG, "binHdr[0] (id[MSB]) = 0x%02x", binHdr[0]);
|
||||
lprintf(LOG_DEBUG, "binHdr[1] (id[LSB]) = 0x%02x", binHdr[1]);
|
||||
lprintf(LOG_DEBUG, "binHdr[2] (version) = 0x%02x", binHdr[2]);
|
||||
lprintf(LOG_DEBUG, "binHdr[3] (type) = 0x%02x", binHdr[3]);
|
||||
lprintf(LOG_DEBUG, "binHdr[4] (length) = 0x%02x", binHdr[4]);
|
||||
|
||||
sdrr = malloc(sizeof(*sdrr));
|
||||
if (sdrr == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
sdrr->id = (binHdr[1] << 8) | binHdr[0]; // LS Byte first
|
||||
sdrr->version = binHdr[2];
|
||||
sdrr->type = binHdr[3];
|
||||
sdrr->length = binHdr[4];
|
||||
|
||||
if ((sdrr->raw = malloc(sdrr->length)) == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
free(sdrr);
|
||||
sdrr = NULL;
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (read(fd, sdrr->raw, sdrr->length) != sdrr->length) {
|
||||
lprintf(LOG_ERR, "SDR from '%s' truncated", filename);
|
||||
free(sdrr->raw);
|
||||
sdrr->raw = NULL;
|
||||
free(sdrr);
|
||||
sdrr = NULL;
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* put in the record queue */
|
||||
if (queue->head == NULL)
|
||||
queue->head = sdrr;
|
||||
else
|
||||
queue->tail->next = sdrr;
|
||||
queue->tail = sdrr;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_file(struct ipmi_intf *intf, const char *ifile)
|
||||
{
|
||||
int rc;
|
||||
struct sdrr_queue sdrr_queue;
|
||||
struct sdr_record_list *sdrr;
|
||||
struct sdr_record_list *sdrr_next;
|
||||
|
||||
/* read the SDR records from file */
|
||||
rc = ipmi_sdr_read_records(ifile, &sdrr_queue);
|
||||
|
||||
if (ipmi_sdr_repo_clear(intf)) {
|
||||
lprintf(LOG_ERR, "Cannot erase SDRR. Giving up.");
|
||||
/* FIXME: free sdr list */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* write the SDRs to the SDR Repository */
|
||||
for (sdrr = sdrr_queue.head; sdrr != NULL; sdrr = sdrr_next) {
|
||||
sdrr_next = sdrr->next;
|
||||
rc = ipmi_sdr_add_record(intf, sdrr);
|
||||
if(rc < 0){
|
||||
lprintf(LOG_ERR, "Cannot add SDR ID 0x%04x to repository...", sdrr->id);
|
||||
}
|
||||
free(sdrr);
|
||||
sdrr = NULL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -97,19 +93,11 @@ print_session_info_csv(const struct get_session_info_rsp * session_info,
|
||||
if (data_len == 18)
|
||||
{
|
||||
/* We have 802.3 LAN data */
|
||||
#ifdef __CYGWIN__
|
||||
printf(",%d.%d.%d.%d",
|
||||
session_info->channel_data.lan_data.console_ip[0],
|
||||
session_info->channel_data.lan_data.console_ip[1],
|
||||
session_info->channel_data.lan_data.console_ip[2],
|
||||
session_info->channel_data.lan_data.console_ip[3]);
|
||||
#else
|
||||
printf(",%s",
|
||||
inet_ntop(AF_INET,
|
||||
&(session_info->channel_data.lan_data.console_ip),
|
||||
buffer,
|
||||
16));
|
||||
#endif
|
||||
|
||||
printf(",%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
session_info->channel_data.lan_data.console_mac[0],
|
||||
@ -137,19 +125,11 @@ print_session_info_csv(const struct get_session_info_rsp * session_info,
|
||||
printf(",%d",
|
||||
session_info->channel_data.modem_data.destination_selector);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
printf(",%d.%d.%d.%d",
|
||||
session_info->channel_data.modem_data.console_ip[0],
|
||||
session_info->channel_data.modem_data.console_ip[1],
|
||||
session_info->channel_data.modem_data.console_ip[2],
|
||||
session_info->channel_data.modem_data.console_ip[3]);
|
||||
#else
|
||||
printf(",%s",
|
||||
inet_ntop(AF_INET,
|
||||
&(session_info->channel_data.modem_data.console_ip),
|
||||
buffer,
|
||||
16));
|
||||
#endif
|
||||
|
||||
if (data_len == 14)
|
||||
{
|
||||
@ -201,19 +181,11 @@ print_session_info_verbose(const struct get_session_info_rsp * session_info,
|
||||
if (data_len == 18)
|
||||
{
|
||||
/* We have 802.3 LAN data */
|
||||
#ifdef __CYGWIN__
|
||||
printf("console ip : %d.%d.%d.%d\n",
|
||||
session_info->channel_data.lan_data.console_ip[0],
|
||||
session_info->channel_data.lan_data.console_ip[1],
|
||||
session_info->channel_data.lan_data.console_ip[2],
|
||||
session_info->channel_data.lan_data.console_ip[3]);
|
||||
#else
|
||||
printf("console ip : %s\n",
|
||||
inet_ntop(AF_INET,
|
||||
&(session_info->channel_data.lan_data.console_ip),
|
||||
buffer,
|
||||
16));
|
||||
#endif
|
||||
|
||||
printf("console mac : %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
session_info->channel_data.lan_data.console_mac[0],
|
||||
@ -241,19 +213,11 @@ print_session_info_verbose(const struct get_session_info_rsp * session_info,
|
||||
printf("Destination selector : %d\n",
|
||||
session_info->channel_data.modem_data.destination_selector);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
printf("console ip : %d.%d.%d.%d\n",
|
||||
session_info->channel_data.modem_data.console_ip[0],
|
||||
session_info->channel_data.modem_data.console_ip[1],
|
||||
session_info->channel_data.modem_data.console_ip[2],
|
||||
session_info->channel_data.modem_data.console_ip[3]);
|
||||
#else
|
||||
printf("console ip : %s\n",
|
||||
inet_ntop(AF_INET,
|
||||
&(session_info->channel_data.modem_data.console_ip),
|
||||
buffer,
|
||||
16));
|
||||
#endif
|
||||
|
||||
if (data_len == 14)
|
||||
{
|
||||
@ -436,7 +400,12 @@ ipmi_session_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (argc >= 3)
|
||||
{
|
||||
session_request_type = IPMI_SESSION_REQUEST_BY_ID;
|
||||
id_or_handle = strtol(argv[2], NULL, 16);
|
||||
if (str2uint(argv[2], &id_or_handle) != 0) {
|
||||
lprintf(LOG_ERR, "HEX number expected, but '%s' given.",
|
||||
argv[2]);
|
||||
printf_session_usage();
|
||||
retval = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -450,7 +419,12 @@ ipmi_session_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (argc >= 3)
|
||||
{
|
||||
session_request_type = IPMI_SESSION_REQUEST_BY_HANDLE;
|
||||
id_or_handle = strtol(argv[2], NULL, 16);
|
||||
if (str2uint(argv[2], &id_or_handle) != 0) {
|
||||
lprintf(LOG_ERR, "HEX number expected, but '%s' given.",
|
||||
argv[2]);
|
||||
printf_session_usage();
|
||||
retval = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
@ -42,16 +38,117 @@
|
||||
|
||||
const struct valstr ipmi_oem_info[] = {
|
||||
|
||||
{ IPMI_OEM_UNKNOWN, "Unknown" },
|
||||
{ IPMI_OEM_SUN, "Sun Microsystems" },
|
||||
{ IPMI_OEM_INTEL, "Intel Corporation" },
|
||||
{ IPMI_OEM_TYAN, "Tyan Computer Corporation" },
|
||||
{ IPMI_OEM_NEWISYS, "Newisys" },
|
||||
{ IPMI_OEM_SUPERMICRO, "Supermicro" },
|
||||
{ IPMI_OEM_KONTRON, "Kontron" },
|
||||
{ IPMI_OEM_UNKNOWN, "Unknown" },
|
||||
{ IPMI_OEM_HP, "Hewlett-Packard" },
|
||||
{ IPMI_OEM_SUN, "Sun Microsystems" },
|
||||
{ IPMI_OEM_INTEL, "Intel Corporation" },
|
||||
{ IPMI_OEM_LMC, "LMC" },
|
||||
{ IPMI_OEM_RADISYS, "RadiSys Corporation" },
|
||||
{ IPMI_OEM_TYAN, "Tyan Computer Corporation" },
|
||||
{ IPMI_OEM_NEWISYS, "Newisys" },
|
||||
{ IPMI_OEM_SUPERMICRO, "Supermicro" },
|
||||
{ IPMI_OEM_GOOGLE, "Google" },
|
||||
{ IPMI_OEM_KONTRON, "Kontron" },
|
||||
{ IPMI_OEM_NOKIA, "Nokia" },
|
||||
{ IPMI_OEM_PICMG, "PICMG" },
|
||||
{ IPMI_OEM_PEPPERCON, "Peppercon AG" },
|
||||
{ IPMI_OEM_DELL, "DELL Inc" },
|
||||
{ IPMI_OEM_NEC, "NEC" },
|
||||
{ IPMI_OEM_MAGNUM, "Magnum Technologies" },
|
||||
{ IPMI_OEM_FUJITSU_SIEMENS, "Fujitsu Siemens" },
|
||||
{ IPMI_OEM_TATUNG, "Tatung" },
|
||||
{ IPMI_OEM_AMI, "AMI" },
|
||||
{ IPMI_OEM_RARITAN, "Raritan" },
|
||||
{ IPMI_OEM_AVOCENT, "Avocent" },
|
||||
{ IPMI_OEM_OSA, "OSA" },
|
||||
{ IPMI_OEM_TOSHIBA, "Toshiba" },
|
||||
{ IPMI_OEM_HITACHI_116, "Hitachi" },
|
||||
{ IPMI_OEM_HITACHI_399, "Hitachi" },
|
||||
{ IPMI_OEM_NOKIA_SIEMENS_NETWORKS, "Nokia Siemens Networks" },
|
||||
{ IPMI_OEM_BULL, "Bull Company" },
|
||||
{ IPMI_OEM_PPS, "Pigeon Point Systems" },
|
||||
{ IPMI_OEM_BROADCOM, "Broadcom Corporation" },
|
||||
{ 0xffff , NULL },
|
||||
};
|
||||
|
||||
const struct oemvalstr ipmi_oem_product_info[] = {
|
||||
/* Keep OEM grouped together */
|
||||
/* Intel stuff, thanks to Tim Bell */
|
||||
{ IPMI_OEM_INTEL, 0x000C, "TSRLT2" },
|
||||
{ IPMI_OEM_INTEL, 0x001B, "TIGPR2U" },
|
||||
{ IPMI_OEM_INTEL, 0x0022, "TIGI2U" },
|
||||
{ IPMI_OEM_INTEL, 0x0026, "Bridgeport" },
|
||||
{ IPMI_OEM_INTEL, 0x0028, "S5000PAL" },
|
||||
{ IPMI_OEM_INTEL, 0x0029, "S5000PSL" },
|
||||
{ IPMI_OEM_INTEL, 0x0100, "Tiger4" },
|
||||
{ IPMI_OEM_INTEL, 0x0103, "McCarran" },
|
||||
{ IPMI_OEM_INTEL, 0x0800, "ZT5504" },
|
||||
{ IPMI_OEM_INTEL, 0x0808, "MPCBL0001" },
|
||||
{ IPMI_OEM_INTEL, 0x0811, "TIGW1U" },
|
||||
{ IPMI_OEM_INTEL, 0x4311, "NSI2U" },
|
||||
/* Kontron */
|
||||
{ IPMI_OEM_KONTRON,4000, "AM4000 AdvancedMC" },
|
||||
{ IPMI_OEM_KONTRON,4001, "AM4001 AdvancedMC" },
|
||||
{ IPMI_OEM_KONTRON,4002, "AM4002 AdvancedMC" },
|
||||
{ IPMI_OEM_KONTRON,4010, "AM4010 AdvancedMC" },
|
||||
{ IPMI_OEM_KONTRON,5503, "AM4500/4520 AdvancedMC" },
|
||||
{ IPMI_OEM_KONTRON,5504, "AM4300 AdvancedMC" },
|
||||
{ IPMI_OEM_KONTRON,5507, "AM4301 AdvancedMC" },
|
||||
{ IPMI_OEM_KONTRON,5508, "AM4330 AdvancedMC" },
|
||||
{ IPMI_OEM_KONTRON,5520, "KTC5520/EATX" },
|
||||
{ IPMI_OEM_KONTRON,5703, "RTM8020" },
|
||||
{ IPMI_OEM_KONTRON,5704, "RTM8030" },
|
||||
{ IPMI_OEM_KONTRON,5705, "RTM8050" },
|
||||
{ IPMI_OEM_KONTRON,6000, "CP6000" },
|
||||
{ IPMI_OEM_KONTRON,6006, "DT-64" },
|
||||
{ IPMI_OEM_KONTRON,6010, "CP6010" },
|
||||
{ IPMI_OEM_KONTRON,6011, "CP6011" },
|
||||
{ IPMI_OEM_KONTRON,6012, "CP6012" },
|
||||
{ IPMI_OEM_KONTRON,6014, "CP6014" },
|
||||
{ IPMI_OEM_KONTRON,5002, "AT8001" },
|
||||
{ IPMI_OEM_KONTRON,5003, "AT8010" },
|
||||
{ IPMI_OEM_KONTRON,5004, "AT8020" },
|
||||
{ IPMI_OEM_KONTRON,5006, "AT8030 IPMC" },
|
||||
{ IPMI_OEM_KONTRON,2025, "AT8030 MMC" },
|
||||
{ IPMI_OEM_KONTRON,5007, "AT8050" },
|
||||
{ IPMI_OEM_KONTRON,5301, "AT8400" },
|
||||
{ IPMI_OEM_KONTRON,5303, "AT8901" },
|
||||
/* Broadcom */
|
||||
{ IPMI_OEM_BROADCOM, 5725, "BCM5725" },
|
||||
|
||||
{ 0xffffff , 0xffff , NULL },
|
||||
};
|
||||
|
||||
const struct oemvalstr ipmi_oem_sdr_type_vals[] = {
|
||||
/* Keep OEM grouped together */
|
||||
{ IPMI_OEM_KONTRON , 0xC0 , "OEM Firmware Info" },
|
||||
{ IPMI_OEM_KONTRON , 0xC2 , "OEM Init Agent" },
|
||||
{ IPMI_OEM_KONTRON , 0xC3 , "OEM IPMBL Link State" },
|
||||
{ IPMI_OEM_KONTRON , 0xC4 , "OEM Board Reset" },
|
||||
{ IPMI_OEM_KONTRON , 0xC5 , "OEM FRU Information Agent" },
|
||||
{ IPMI_OEM_KONTRON , 0xC6 , "OEM POST Value Sensor" },
|
||||
{ IPMI_OEM_KONTRON , 0xC7 , "OEM FWUM Status" },
|
||||
{ IPMI_OEM_KONTRON , 0xC8 , "OEM Switch Mngt Software Status" },
|
||||
{ IPMI_OEM_KONTRON , 0xC9 , "OEM OEM Diagnostic Status" },
|
||||
{ IPMI_OEM_KONTRON , 0xCA , "OEM Component Firmware Upgrade" },
|
||||
{ IPMI_OEM_KONTRON , 0xCB , "OEM FRU Over Current" },
|
||||
{ IPMI_OEM_KONTRON , 0xCC , "OEM FRU Sensor Error" },
|
||||
{ IPMI_OEM_KONTRON , 0xCD , "OEM FRU Power Denied" },
|
||||
{ IPMI_OEM_KONTRON , 0xCE , "OEM Reserved" },
|
||||
{ IPMI_OEM_KONTRON , 0xCF , "OEM Board Reset" },
|
||||
{ IPMI_OEM_KONTRON , 0xD0 , "OEM Clock Resource Control" },
|
||||
{ IPMI_OEM_KONTRON , 0xD1 , "OEM Power State" },
|
||||
{ IPMI_OEM_KONTRON , 0xD2 , "OEM FRU Mngt Power Failure" },
|
||||
{ IPMI_OEM_KONTRON , 0xD3 , "OEM Jumper Status" },
|
||||
{ IPMI_OEM_KONTRON , 0xF2 , "OEM RTM Module Hotswap" },
|
||||
|
||||
{ IPMI_OEM_PICMG , 0xF0 , "PICMG FRU Hotswap" },
|
||||
{ IPMI_OEM_PICMG , 0xF1 , "PICMG IPMB0 Link State" },
|
||||
{ IPMI_OEM_PICMG , 0xF2 , "PICMG Module Hotswap" },
|
||||
|
||||
{ 0xffffff, 0x00, NULL }
|
||||
};
|
||||
|
||||
const struct valstr ipmi_netfn_vals[] = {
|
||||
{ IPMI_NETFN_CHASSIS, "Chassis" },
|
||||
{ IPMI_NETFN_BRIDGE, "Bridge" },
|
||||
@ -66,7 +163,7 @@ const struct valstr ipmi_netfn_vals[] = {
|
||||
/*
|
||||
* From table 26-4 of the IPMI v2 specification
|
||||
*/
|
||||
const struct valstr impi_bit_rate_vals[] = {
|
||||
const struct valstr ipmi_bit_rate_vals[] = {
|
||||
{ 0x00, "IPMI-Over-Serial-Setting"}, /* Using the value in the IPMI Over Serial Config */
|
||||
{ 0x06, "9.6" },
|
||||
{ 0x07, "19.2" },
|
||||
@ -110,6 +207,7 @@ const struct valstr ipmi_authtype_session_vals[] = {
|
||||
{ IPMI_SESSION_AUTHTYPE_MD5, "MD5" },
|
||||
{ IPMI_SESSION_AUTHTYPE_PASSWORD, "PASSWORD" },
|
||||
{ IPMI_SESSION_AUTHTYPE_OEM, "OEM" },
|
||||
{ IPMI_SESSION_AUTHTYPE_RMCP_PLUS,"RMCP+" },
|
||||
{ 0xFF, NULL },
|
||||
};
|
||||
|
||||
@ -165,18 +263,40 @@ const struct valstr entity_id_vals[] = {
|
||||
{ 0x26, "Remote Management Device" },
|
||||
{ 0x27, "External Environment" },
|
||||
{ 0x28, "Battery" },
|
||||
{ 0x29, "Processing Blade" },
|
||||
{ 0x2A, "Connectivity Switch" },
|
||||
{ 0x2B, "Processor/Memory Module" },
|
||||
{ 0x2C, "I/O Module" },
|
||||
{ 0x2D, "Processor/IO Module" },
|
||||
{ 0x2E, "Management Controller Firmware" },
|
||||
{ 0x2F, "IPMI Channel" },
|
||||
{ 0x30, "PCI Bus" },
|
||||
{ 0x31, "PCI Express Bus" },
|
||||
{ 0x32, "SCSI Bus (parallel)" },
|
||||
{ 0x33, "SATA/SAS Bus" },
|
||||
{ 0x34, "Processor/Front-Side Bus" },
|
||||
{ 0x29, "Processing Blade" },
|
||||
{ 0x2A, "Connectivity Switch" },
|
||||
{ 0x2B, "Processor/Memory Module" },
|
||||
{ 0x2C, "I/O Module" },
|
||||
{ 0x2D, "Processor/IO Module" },
|
||||
{ 0x2E, "Management Controller Firmware" },
|
||||
{ 0x2F, "IPMI Channel" },
|
||||
{ 0x30, "PCI Bus" },
|
||||
{ 0x31, "PCI Express Bus" },
|
||||
{ 0x32, "SCSI Bus (parallel)" },
|
||||
{ 0x33, "SATA/SAS Bus" },
|
||||
{ 0x34, "Processor/Front-Side Bus" },
|
||||
{ 0x35, "Real Time Clock(RTC)" },
|
||||
{ 0x36, "Reserved" },
|
||||
{ 0x37, "Air Inlet" },
|
||||
{ 0x38, "Reserved" },
|
||||
{ 0x39, "Reserved" },
|
||||
{ 0x3A, "Reserved" },
|
||||
{ 0x3B, "Reserved" },
|
||||
{ 0x3C, "Reserved" },
|
||||
{ 0x3D, "Reserved" },
|
||||
{ 0x3E, "Reserved" },
|
||||
{ 0x3F, "Reserved" },
|
||||
{ 0x40, "Air Inlet" },
|
||||
{ 0x41, "Processor" },
|
||||
{ 0x42, "Baseboard/Main System Board" },
|
||||
/* PICMG */
|
||||
{ 0xA0, "PICMG Front Board" },
|
||||
{ 0xC0, "PICMG Rear Transition Module" },
|
||||
{ 0xC1, "PICMG AdvancedMC Module" },
|
||||
{ 0xF0, "PICMG Shelf Management Controller" },
|
||||
{ 0xF1, "PICMG Filtration Unit" },
|
||||
{ 0xF2, "PICMG Shelf FRU Information" },
|
||||
{ 0xF3, "PICMG Alarm Panel" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
@ -285,6 +405,7 @@ const struct valstr completion_code_vals[] = {
|
||||
{ 0xd3, "Destination unavailable" },
|
||||
{ 0xd4, "Insufficient privilege level" },
|
||||
{ 0xd5, "Command not supported in present state" },
|
||||
{ 0xd6, "Cannot execute command, command disabled" },
|
||||
{ 0xff, "Unspecified error" },
|
||||
{ 0x00, NULL }
|
||||
};
|
||||
@ -321,3 +442,137 @@ const struct valstr ipmi_encryption_algorithms[] = {
|
||||
{ IPMI_CRYPT_XRC4_40, "xrc4_40" },
|
||||
{ 0x00, NULL }
|
||||
};
|
||||
|
||||
const struct valstr picmg_frucontrol_vals[] = {
|
||||
{ 0, "Cold Reset" },
|
||||
{ 1, "Warm Reset" },
|
||||
{ 2, "Graceful Reboot" },
|
||||
{ 3, "Issue Diagnostic Interrupt" },
|
||||
{ 4, "Quiesce" },
|
||||
{ 5, NULL },
|
||||
};
|
||||
|
||||
const struct valstr picmg_clk_family_vals[] = {
|
||||
{ 0x00, "Unspecified" },
|
||||
{ 0x01, "SONET/SDH/PDH" },
|
||||
{ 0x02, "Reserved for PCI Express" },
|
||||
{ 0x03, "Reserved" }, /* from 03h to C8h */
|
||||
{ 0xC9, "Vendor defined clock family" }, /* from C9h to FFh */
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct oemvalstr picmg_clk_accuracy_vals[] = {
|
||||
{ 0x01, 10, "PRS" },
|
||||
{ 0x01, 20, "STU" },
|
||||
{ 0x01, 30, "ST2" },
|
||||
{ 0x01, 40, "TNC" },
|
||||
{ 0x01, 50, "ST3E" },
|
||||
{ 0x01, 60, "ST3" },
|
||||
{ 0x01, 70, "SMC" },
|
||||
{ 0x01, 80, "ST4" },
|
||||
{ 0x01, 90, "DUS" },
|
||||
{ 0x02, 0xE0, "PCI Express Generation 2" },
|
||||
{ 0x02, 0xF0, "PCI Express Generation 1" },
|
||||
{ 0xffffff, 0x00, NULL }
|
||||
};
|
||||
|
||||
const struct oemvalstr picmg_clk_resource_vals[] = {
|
||||
{ 0x0, 0, "On-Carrier Device 0" },
|
||||
{ 0x0, 1, "On-Carrier Device 1" },
|
||||
{ 0x1, 1, "AMC Site 1 - A1" },
|
||||
{ 0x1, 2, "AMC Site 1 - A2" },
|
||||
{ 0x1, 3, "AMC Site 1 - A3" },
|
||||
{ 0x1, 4, "AMC Site 1 - A4" },
|
||||
{ 0x1, 5, "AMC Site 1 - B1" },
|
||||
{ 0x1, 6, "AMC Site 1 - B2" },
|
||||
{ 0x1, 7, "AMC Site 1 - B3" },
|
||||
{ 0x1, 8, "AMC Site 1 - B4" },
|
||||
{ 0x2, 0, "ATCA Backplane" },
|
||||
{ 0xffffff, 0x00, NULL }
|
||||
};
|
||||
|
||||
const struct oemvalstr picmg_clk_id_vals[] = {
|
||||
{ 0x0, 0, "Clock 0" },
|
||||
{ 0x0, 1, "Clock 1" },
|
||||
{ 0x0, 2, "Clock 2" },
|
||||
{ 0x0, 3, "Clock 3" },
|
||||
{ 0x0, 4, "Clock 4" },
|
||||
{ 0x0, 5, "Clock 5" },
|
||||
{ 0x0, 6, "Clock 6" },
|
||||
{ 0x0, 7, "Clock 7" },
|
||||
{ 0x0, 8, "Clock 8" },
|
||||
{ 0x0, 9, "Clock 9" },
|
||||
{ 0x0, 10, "Clock 10" },
|
||||
{ 0x0, 11, "Clock 11" },
|
||||
{ 0x0, 12, "Clock 12" },
|
||||
{ 0x0, 13, "Clock 13" },
|
||||
{ 0x0, 14, "Clock 14" },
|
||||
{ 0x0, 15, "Clock 15" },
|
||||
{ 0x1, 1, "TCLKA" },
|
||||
{ 0x1, 2, "TCLKB" },
|
||||
{ 0x1, 3, "TCLKC" },
|
||||
{ 0x1, 4, "TCLKD" },
|
||||
{ 0x1, 5, "FLCKA" },
|
||||
{ 0x2, 1, "CLK1A" },
|
||||
{ 0x2, 2, "CLK1A" },
|
||||
{ 0x2, 3, "CLK1A" },
|
||||
{ 0x2, 4, "CLK1A" },
|
||||
{ 0x2, 5, "CLK1A" },
|
||||
{ 0x2, 6, "CLK1A" },
|
||||
{ 0x2, 7, "CLK1A" },
|
||||
{ 0x2, 8, "CLK1A" },
|
||||
{ 0x2, 9, "CLK1A" },
|
||||
{ 0xffffff, 0x00, NULL }
|
||||
};
|
||||
|
||||
const struct valstr picmg_busres_id_vals[] = {
|
||||
{ 0x0, "Metallic Test Bus pair #1" },
|
||||
{ 0x1, "Metallic Test Bus pair #2" },
|
||||
{ 0x2, "Synch clock group 1 (CLK1)" },
|
||||
{ 0x3, "Synch clock group 2 (CLK2)" },
|
||||
{ 0x4, "Synch clock group 3 (CLK3)" },
|
||||
{ 0x5, NULL }
|
||||
};
|
||||
const struct valstr picmg_busres_board_cmd_vals[] = {
|
||||
{ 0x0, "Query" },
|
||||
{ 0x1, "Release" },
|
||||
{ 0x2, "Force" },
|
||||
{ 0x3, "Bus Free" },
|
||||
{ 0x4, NULL }
|
||||
};
|
||||
|
||||
const struct valstr picmg_busres_shmc_cmd_vals[] = {
|
||||
{ 0x0, "Request" },
|
||||
{ 0x1, "Relinquish" },
|
||||
{ 0x2, "Notify" },
|
||||
{ 0x3, NULL }
|
||||
};
|
||||
|
||||
const struct oemvalstr picmg_busres_board_status_vals[] = {
|
||||
{ 0x0, 0x0, "In control" },
|
||||
{ 0x0, 0x1, "No control" },
|
||||
{ 0x1, 0x0, "Ack" },
|
||||
{ 0x1, 0x1, "Refused" },
|
||||
{ 0x1, 0x2, "No control" },
|
||||
{ 0x2, 0x0, "Ack" },
|
||||
{ 0x2, 0x1, "No control" },
|
||||
{ 0x3, 0x0, "Accept" },
|
||||
{ 0x3, 0x1, "Not Needed" },
|
||||
{ 0xffffff, 0x00, NULL }
|
||||
};
|
||||
|
||||
const struct oemvalstr picmg_busres_shmc_status_vals[] = {
|
||||
{ 0x0, 0x0, "Grant" },
|
||||
{ 0x0, 0x1, "Busy" },
|
||||
{ 0x0, 0x2, "Defer" },
|
||||
{ 0x0, 0x3, "Deny" },
|
||||
|
||||
{ 0x1, 0x0, "Ack" },
|
||||
{ 0x1, 0x1, "Error" },
|
||||
|
||||
{ 0x2, 0x0, "Ack" },
|
||||
{ 0x2, 0x1, "Error" },
|
||||
{ 0x2, 0x2, "Deny" },
|
||||
|
||||
{ 0xffffff, 0x00, NULL }
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user