summaryrefslogtreecommitdiff
path: root/OptionRomPkg/DriverHealthDxe/DriverHealthDxe.c
blob: 5f56cfb0c85e490be1ac5b0479c3c60465744541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
/** @file
  DiskIo driver that lays on every BlockIo protocol in the system.
  DiskIo converts a block oriented device to a byte oriented device.

  Disk access may have to handle unaligned request about sector boundaries.
  There are three cases:
    UnderRun - The first byte is not on a sector boundary or the read request is
               less than a sector in length.
    Aligned  - A read of N contiguous sectors.
    OverRun  - The last byte is not on a sector boundary.

Copyright (c) 2006 - 2009, Intel Corporation. <BR>
  All rights reserved. This program and the accompanying materials                          
  are licensed and made available under the terms and conditions of the BSD License         
  which accompanies this distribution.  The full text of the license may be found at        
  http://opensource.org/licenses/bsd-license.php                                            

  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             

**/

#include "DriverHealthDxe.h"

#undef STRING_TOKEN
#define STRING_TOKEN(x) 0

extern EFI_GUID gEfiCallerIdGuid;

CHAR16 VariableName[]    = L"Config";
UINTN  mNumNotHealthy = 0;
UINT8  ControllerIndex = 0;

//
// Link used to store the controller health status
//
LIST_ENTRY  mControllerList = {NULL, NULL};

//
// 0           - Healthy -> {0}
// 1           - Health with warning messages -> {1}
// 2           - Failed -> {2}
// 3           - Failed with error messages -> {3}
// 4           - RebootRequired -> {4}
// 5           - RebootRequired with messages -> {5}
// 6           - ReconnectRequired -> {6}
// 7           - ReconnectRequired with messages -> {7}
// 100..103    - RepairRequired -> {0..3}
// 104..107    - RepairRequired with error messages -> {0..3}
// 108..111    - RepairRequired with progress notifications -> {0..3}
// 112..115    - RepairRequired with error messages and progress notifications -> {0..3}
// 132..163    - RepairRequired -> {300..331}
// 164..195    - RepairRequired with error messages -> {300..331}
// 196..227    - RepairRequired with progress notifications -> {300..331}
// 228..259    - RepairRequired with error messages and progress notifications -> {300..331}
// 300..307    - ConfigRequired -> {0..7}
// 308..315    - ConfigRequired with error messages -> {0..7}
// 316..323    - ConfigRequired with forms -> {0..7}
// 324..331    - ConfigRequired with forms and error messages -> {0..7}
// 332..347    - ConfigRequired -> {100..115}
// 348..363    - ConfigRequired with error messages -> {100..115}
// 364..379    - ConfigRequired with forms -> {100.115}
// 380..395    - ConfigRequired with forms and error messages -> {100..115}

DEVICE_STATE  mDeviceState[] = {
  { TRUE,  308, 000, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  309, 001, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  310, 002, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  311, 003, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  312, 004, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  313, 005, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  314, 006, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  315, 007, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  000, 000, 0,                                       FALSE, EfiDriverHealthStatusHealthy },
  { TRUE,  001, 001, STRING_TOKEN (STR_HEALTHY_WARNING),      FALSE, EfiDriverHealthStatusHealthy },

  { TRUE,  002, 002, 0,                                       FALSE, EfiDriverHealthStatusFailed },
  { TRUE,  003, 003, STRING_TOKEN (STR_FAILED_ERROR),         FALSE, EfiDriverHealthStatusFailed },

  { FALSE, 004, 004, 0,                                       FALSE, EfiDriverHealthStatusRebootRequired },
  { FALSE, 005, 005, STRING_TOKEN (STR_REBOOT_REQUIRED),      FALSE, EfiDriverHealthStatusRebootRequired },

  { FALSE, 006, 006, 0,                                       FALSE, EfiDriverHealthStatusReconnectRequired },
  { FALSE, 007, 007, STRING_TOKEN (STR_RECONNECT_REQUIRED),   FALSE, EfiDriverHealthStatusReconnectRequired },

  { TRUE,  100, 000, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired },
  { TRUE,  101, 001, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired },
  { TRUE,  102, 002, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired },
  { TRUE,  103, 003, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired },

  { TRUE,  104, 000, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  105, 001, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  106, 002, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  107, 003, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },

  { TRUE,  108, 000, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired   },
  { TRUE,  109, 001, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired   },
  { TRUE,  110, 002, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired   },
  { TRUE,  111, 003, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired   },

  { TRUE,  112, 000, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired   },
  { TRUE,  113, 001, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired   },
  { TRUE,  114, 002, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired   },
  { TRUE,  115, 003, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired   },

  { TRUE,  132, 300, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  133, 301, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  134, 302, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  135, 303, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  136, 304, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  137, 305, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  138, 306, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  139, 307, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  140, 308, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  141, 309, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  142, 310, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  143, 311, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  144, 312, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  145, 313, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  146, 314, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  147, 315, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  148, 316, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  149, 317, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  150, 318, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  151, 319, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  152, 320, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  153, 321, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  154, 322, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  155, 323, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  156, 324, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  157, 325, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  158, 326, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  159, 327, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  160, 328, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  161, 329, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  162, 330, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  163, 331, 0,                                       FALSE, EfiDriverHealthStatusRepairRequired  },

  { TRUE,  164, 300, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  165, 301, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  166, 302, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  167, 303, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  168, 304, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  169, 305, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  170, 306, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  171, 307, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  172, 308, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  173, 309, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  174, 310, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  175, 311, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  176, 312, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  177, 313, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  178, 314, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  179, 315, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  180, 316, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  181, 317, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  182, 318, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  183, 319, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  184, 320, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  185, 321, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  186, 322, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  187, 323, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  188, 324, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  189, 325, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  190, 326, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  191, 327, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  192, 328, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  193, 329, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  194, 330, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  195, 331, STRING_TOKEN (STR_REPAIR_REQUIRED),      FALSE, EfiDriverHealthStatusRepairRequired  },

  { TRUE,  196, 300, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  197, 301, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  198, 302, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  199, 303, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  200, 304, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  201, 305, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  202, 306, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  203, 307, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  204, 308, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  205, 309, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  206, 310, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  207, 311, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  208, 312, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  209, 313, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  210, 314, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  211, 315, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  212, 316, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  213, 317, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  214, 318, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  215, 319, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  216, 320, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  217, 321, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  218, 322, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  219, 323, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  220, 324, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  221, 325, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  222, 326, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  223, 327, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  224, 328, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  225, 329, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  226, 330, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  227, 331, 0,                                       TRUE, EfiDriverHealthStatusRepairRequired  },

  { TRUE,  228, 300, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  229, 301, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  230, 302, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  231, 303, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  232, 304, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  233, 305, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  234, 306, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  235, 307, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  236, 308, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  237, 309, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  238, 310, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  239, 311, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  240, 312, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  241, 313, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  242, 314, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  243, 315, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  244, 316, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  245, 317, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  246, 318, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  247, 319, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  248, 320, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  249, 321, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  250, 322, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  251, 323, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  252, 324, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  253, 325, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  254, 326, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  255, 327, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  256, 328, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  257, 329, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  258, 330, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },
  { TRUE,  259, 331, STRING_TOKEN (STR_REPAIR_REQUIRED),      TRUE, EfiDriverHealthStatusRepairRequired  },

  { TRUE,  300, 000, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  301, 001, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  302, 002, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  303, 003, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  304, 004, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  305, 005, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  306, 006, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  307, 007, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  308, 000, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  309, 001, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  310, 002, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  311, 003, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  312, 004, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  313, 005, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  314, 006, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  315, 007, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  316, 000, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  317, 001, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  318, 002, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  319, 003, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  320, 004, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  321, 005, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  322, 006, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  323, 007, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  324, 000, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  325, 001, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  326, 002, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  327, 003, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  328, 004, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  329, 005, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  330, 006, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  331, 007, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  332, 100, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  333, 101, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  334, 102, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  335, 103, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  336, 104, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  337, 105, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  338, 106, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  339, 107, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  340, 108, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  341, 109, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  342, 110, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  343, 111, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  344, 112, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  345, 113, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  346, 114, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  347, 115, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  348, 100, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  349, 101, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  350, 102, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  351, 103, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  352, 104, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  353, 105, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  354, 106, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  355, 107, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  356, 108, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  357, 109, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  358, 110, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  359, 111, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  360, 112, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  361, 113, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  362, 114, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  363, 115, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  364, 100, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  365, 101, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  366, 102, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  367, 103, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  368, 104, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  369, 105, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  370, 106, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  371, 107, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  372, 108, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  373, 109, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  374, 110, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  375, 111, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  376, 112, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  377, 113, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  378, 114, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  379, 115, 0,                                       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  380, 100, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  381, 101, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  382, 102, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  383, 103, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  384, 104, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  385, 105, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  386, 106, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  387, 107, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  388, 108, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  389, 109, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  390, 110, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  391, 111, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  392, 112, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  393, 113, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  394, 114, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },
  { TRUE,  395, 115, STRING_TOKEN (STR_CONFIG_WARNING),       FALSE, EfiDriverHealthStatusConfigurationRequired },

  { TRUE,  999, 999, 0,                                       FALSE }
};

HII_VENDOR_DEVICE_PATH  mHiiVendorDevicePathDiskIoDummy = {
  {
    {
      HARDWARE_DEVICE_PATH,
        HW_VENDOR_DP,
      {
        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
          (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
      }
    },
      //
      // {C153B68E-EBFC-488e-B110-662867745BBE}
      //
    { 0xc153b68e, 0xebfc, 0x488e, { 0xb1, 0x10, 0x66, 0x28, 0x67, 0x74, 0x5b, 0xbe} }
  },
  {
    END_DEVICE_PATH_TYPE,
      END_ENTIRE_DEVICE_PATH_SUBTYPE,
    { 
      (UINT8) (END_DEVICE_PATH_LENGTH),
        (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
    }
  }
};

EFI_HII_HANDLE     mHiiHandle = NULL;

EFI_DRIVER_BINDING_PROTOCOL gDiskIoDriverBinding = {
  DiskIoDriverBindingSupported,
  DiskIoDriverBindingStart,
  DiskIoDriverBindingStop,
  0xaa,
  NULL,
  NULL
};

EFI_DRIVER_HEALTH_PROTOCOL gDiskIoDriverHealth = {
  DiskIoDriverHealthGetHealthStatus,
  DiskIoDriverHealthRepair
};
//
// Template for DiskIo private data structure.
// The pointer to BlockIo protocol interface is assigned dynamically.
//
DISK_IO_PRIVATE_DATA gDiskIoPrivateDataTemplate = {
  DISK_IO_PRIVATE_DATA_SIGNATURE,
  {
    EFI_DISK_IO_PROTOCOL_REVISION,
    DiskIoReadDisk,
    DiskIoWriteDisk
  },
  NULL,
  NULL, // Handle
  NULL, // Consumed Protocol
  NULL,
  //
  // Produced Protocol
  //
  {
    DummyExtractConfig,
    DummyRouteConfig,
    DummyDriverCallback
  },
  //
  // NVdata
  //
  { 0x0 },
  //
  // Controller Name
  //
  NULL,
  //
  // Controller Index
  //
  0
};

DEVICE_STATE *
GetDeviceState (
  UINTN  DeviceStateNumber
  )
{
  UINTN  Index;

  for (Index = 0; mDeviceState[Index].CurrentState != 999 && mDeviceState[Index].CurrentState != DeviceStateNumber; Index++);
  ASSERT (mDeviceState[Index].CurrentState != 999);

  return &mDeviceState[Index];
}


/**
  Test to see if this driver supports ControllerHandle. 

  @param  This                Protocol instance pointer.
  @param  ControllerHandle    Handle of device to test
  @param  RemainingDevicePath Optional parameter use to pick a specific child
                              device to start.

  @retval EFI_SUCCESS         This driver supports this device
  @retval EFI_ALREADY_STARTED This driver is already running on this device
  @retval other               This driver does not support this device

**/
EFI_STATUS
EFIAPI
DiskIoDriverBindingSupported (
  IN EFI_DRIVER_BINDING_PROTOCOL  *This,
  IN EFI_HANDLE                   ControllerHandle,
  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL
  )
{
  EFI_STATUS            Status;
  EFI_BLOCK_IO_PROTOCOL *BlockIo;

  //
  // Open the IO Abstraction(s) needed to perform the supported test.
  //
  Status = gBS->OpenProtocol (
                  ControllerHandle,
                  &gEfiBlockIoProtocolGuid,
                  (VOID **) &BlockIo,
                  This->DriverBindingHandle,
                  ControllerHandle,
                  EFI_OPEN_PROTOCOL_BY_DRIVER
                  );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Close the I/O Abstraction(s) used to perform the supported test.
  //
  gBS->CloseProtocol (
        ControllerHandle,
        &gEfiBlockIoProtocolGuid,
        This->DriverBindingHandle,
        ControllerHandle
        );
  return EFI_SUCCESS;
}


/**
  Start this driver on ControllerHandle by opening a Block IO protocol and
  installing a Disk IO protocol on ControllerHandle.

  @param  This                 Protocol instance pointer.
  @param  ControllerHandle     Handle of device to bind driver to
  @param  RemainingDevicePath  Optional parameter use to pick a specific child
                               device to start.

  @retval EFI_SUCCESS          This driver is added to ControllerHandle
  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle
  @retval other                This driver does not support this device

**/
EFI_STATUS
EFIAPI
DiskIoDriverBindingStart (
  IN EFI_DRIVER_BINDING_PROTOCOL  *This,
  IN EFI_HANDLE                   ControllerHandle,
  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL
  )
{
  EFI_STATUS            Status;
  DISK_IO_PRIVATE_DATA  *Private;
  DEVICE_STATE          *DeviceState;
  UINTN                 DataSize;
  UINT32                StartCount;
  CONTROLLER_STATE      *ControllerState;

  Private          = NULL;
  ControllerState  = NULL;

  //
  // Connect to the Block IO interface on ControllerHandle.
  //
  Status = gBS->OpenProtocol (
                  ControllerHandle,
                  &gEfiBlockIoProtocolGuid,
                  (VOID **) &gDiskIoPrivateDataTemplate.BlockIo,
                  This->DriverBindingHandle,
                  ControllerHandle,
                  EFI_OPEN_PROTOCOL_BY_DRIVER
                  );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  
  //
  // Initialize the Disk IO device instance.
  //
  Private = AllocateCopyPool (sizeof (DISK_IO_PRIVATE_DATA), &gDiskIoPrivateDataTemplate);
  if (Private == NULL) {
    Status = EFI_OUT_OF_RESOURCES;
    goto ErrorExit;
  }
  
  //
  // Begin Driver Health Protocol Support
  //
  DataSize = sizeof (StartCount);
  Status = gRT->GetVariable (
                  L"StartCount",
                  &gEfiCallerIdGuid,
                  NULL,
                  &DataSize,
                  &StartCount
                  );
  if (EFI_ERROR (Status)) {
    //
    // If the configuration can not be read, then set the default config value of 0
    //
    StartCount = 0;
  }

  ControllerIndex++;

  DeviceState = GetDeviceState (mDeviceState[StartCount].CurrentState);
  ASSERT (DeviceState != NULL);

  ControllerState = AllocateZeroPool (sizeof (CONTROLLER_STATE));
  if (ControllerState == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  
  ControllerState->ControllerHandle  = ControllerHandle;
  ControllerState->Signature         = DISK_IO_CONTROLLER_STATE_SIGNATURE;
  ControllerState->DeviceStateNum    = DeviceState->CurrentState;
  ControllerState->ChildHandle       = NULL;
  ControllerState->ControllerIndex   = ControllerIndex; 

  InsertTailList (&mControllerList, &ControllerState->Link);

  if (DeviceState->HealthStatus != EfiDriverHealthStatusHealthy || DeviceState->StringId != 0) {
    mNumNotHealthy++;
  }

  StartCount++;
  while (!mDeviceState[StartCount].StartState) {
    if (mDeviceState[StartCount].CurrentState == 999) {
      StartCount = 0;
    } else {
      StartCount++;
    }
  }
  if (mDeviceState[StartCount].CurrentState == 999) {
    StartCount = 0;
  }

  Status = gRT->SetVariable (
                  L"StartCount",
                  &gEfiCallerIdGuid,
                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                  sizeof (StartCount),
                  &StartCount
                  );
  ASSERT_EFI_ERROR (Status);

  if (DeviceState->HealthStatus == EfiDriverHealthStatusConfigurationRequired) {
    Private->NVdata.ConfigGood = 0;
  } else {
    Private->NVdata.ConfigGood = 1;
  }
  Status = gRT->SetVariable (
                  L"Config",
                  &gEfiCallerIdGuid,
                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                  sizeof (Private->NVdata.ConfigGood),
                  &Private->NVdata.ConfigGood
                  );
  ASSERT_EFI_ERROR (Status);

  //
  // End Driver Health Protocol Support
  //

  //
  // Install protocol interfaces for the Disk IO device.
  //
  Status = gBS->InstallProtocolInterface (
                  &ControllerHandle,
                  &gEfiDiskIoProtocolGuid,
                  EFI_NATIVE_INTERFACE,
                  &Private->DiskIo
                  );
 
  Private->ControllerIndex = ControllerIndex;
  AddName (Private);

ErrorExit:
  if (EFI_ERROR (Status)) {

    if (Private != NULL) {
      FreeUnicodeStringTable (Private->ControllerNameTable);
      FreePool (Private);
    }

    gBS->CloseProtocol (
          ControllerHandle,
          &gEfiBlockIoProtocolGuid,
          This->DriverBindingHandle,
          ControllerHandle
          );
  }

  return Status;
}


/**
  Stop this driver on ControllerHandle by removing Disk IO protocol and closing
  the Block IO protocol on ControllerHandle.

  @param  This              Protocol instance pointer.
  @param  ControllerHandle  Handle of device to stop driver on
  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of
                            children is zero stop the entire bus driver.
  @param  ChildHandleBuffer List of Child Handles to Stop.

  @retval EFI_SUCCESS       This driver is removed ControllerHandle
  @retval other             This driver was not removed from this device

**/
EFI_STATUS
EFIAPI
DiskIoDriverBindingStop (
  IN  EFI_DRIVER_BINDING_PROTOCOL    *This,
  IN  EFI_HANDLE                     ControllerHandle,
  IN  UINTN                          NumberOfChildren,
  IN  EFI_HANDLE                     *ChildHandleBuffer
  )
{
  EFI_STATUS            Status;
  EFI_DISK_IO_PROTOCOL  *DiskIo;
  DISK_IO_PRIVATE_DATA  *Private;
  DEVICE_STATE          *DeviceState;
  CONTROLLER_STATE      *ControllerState;
  LIST_ENTRY            *Link;

  ControllerState   = NULL;
  DeviceState       = NULL;

  //
  // Get our context back.
  //
  Status = gBS->OpenProtocol (
                  ControllerHandle,
                  &gEfiDiskIoProtocolGuid,
                  (VOID **) &DiskIo,
                  This->DriverBindingHandle,
                  ControllerHandle,
                  EFI_OPEN_PROTOCOL_GET_PROTOCOL
                  );
  if (EFI_ERROR (Status)) {
    return EFI_UNSUPPORTED;
  }

  Private = DISK_IO_PRIVATE_DATA_FROM_THIS (DiskIo);

  Status = gBS->UninstallProtocolInterface (
                  ControllerHandle,
                  &gEfiDiskIoProtocolGuid,
                  &Private->DiskIo
                  );
  if (!EFI_ERROR (Status)) {

    Status = gBS->CloseProtocol (
                    ControllerHandle,
                    &gEfiBlockIoProtocolGuid,
                    This->DriverBindingHandle,
                    ControllerHandle
                    );
    //
    // Get the Controller State from global list
    //
    Link = GetFirstNode (&mControllerList);

    while (!IsNull (&mControllerList, Link)) {
      ControllerState = DISK_IO_CONTROLLER_STATE_FROM_LINK (Link);

      if (ControllerState->ControllerHandle == ControllerHandle) {
        DeviceState = GetDeviceState (ControllerState->DeviceStateNum);
        break;
      }
      Link = GetNextNode (&mControllerList, Link);
    }

    ASSERT (DeviceState != NULL);

    if (DeviceState->HealthStatus != EfiDriverHealthStatusHealthy || DeviceState->StringId != 0) {
      mNumNotHealthy--;
    }
     
    RemoveEntryList (Link);

    if (ControllerState != NULL) {
      FreePool (ControllerState);
    }    
  }

  if (!EFI_ERROR (Status)) {
    FreeUnicodeStringTable (Private->ControllerNameTable);
    FreePool (Private);
  }

  ControllerIndex = 0;
  return Status;
}



/**
  Read BufferSize bytes from Offset into Buffer.
  Reads may support reads that are not aligned on
  sector boundaries. There are three cases:
    UnderRun - The first byte is not on a sector boundary or the read request is
               less than a sector in length.
    Aligned  - A read of N contiguous sectors.
    OverRun  - The last byte is not on a sector boundary.

  @param  This                  Protocol instance pointer.
  @param  MediaId               Id of the media, changes every time the media is replaced.
  @param  Offset                The starting byte offset to read from
  @param  BufferSize            Size of Buffer
  @param  Buffer                Buffer containing read data

  @retval EFI_SUCCESS           The data was read correctly from the device.
  @retval EFI_DEVICE_ERROR      The device reported an error while performing the read.
  @retval EFI_NO_MEDIA          There is no media in the device.
  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.
  @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not
                                valid for the device.

**/
EFI_STATUS
EFIAPI
DiskIoReadDisk (
  IN EFI_DISK_IO_PROTOCOL  *This,
  IN UINT32                MediaId,
  IN UINT64                Offset,
  IN UINTN                 BufferSize,
  OUT VOID                 *Buffer
  )
{
  EFI_STATUS            Status;
  DISK_IO_PRIVATE_DATA  *Private;
  EFI_BLOCK_IO_PROTOCOL *BlockIo;
  EFI_BLOCK_IO_MEDIA    *Media;
  UINT32                BlockSize;
  UINT64                Lba;
  UINT64                OverRunLba;
  UINT32                UnderRun;
  UINT32                OverRun;
  BOOLEAN               TransactionComplete;
  UINTN                 WorkingBufferSize;
  UINT8                 *WorkingBuffer;
  UINTN                 Length;
  UINT8                 *Data;
  UINT8                 *PreData;
  UINTN                 IsBufferAligned;
  UINTN                 DataBufferSize;
  BOOLEAN               LastRead;

  Private   = DISK_IO_PRIVATE_DATA_FROM_THIS (This);

  BlockIo   = Private->BlockIo;
  Media     = BlockIo->Media;
  BlockSize = Media->BlockSize;

  if (Media->MediaId != MediaId) {
    return EFI_MEDIA_CHANGED;
  }

  WorkingBuffer     = Buffer;
  WorkingBufferSize = BufferSize;

  //
  // Allocate a temporary buffer for operation
  //
  DataBufferSize = BlockSize * DATA_BUFFER_BLOCK_NUM;

  if (Media->IoAlign > 1) {
    PreData = AllocatePool (DataBufferSize + Media->IoAlign);
    Data    = PreData - ((UINTN) PreData & (Media->IoAlign - 1)) + Media->IoAlign;
  } else {
    PreData = AllocatePool (DataBufferSize);
    Data    = PreData;
  }

  if (PreData == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }

  Lba                 = DivU64x32Remainder (Offset, BlockSize, &UnderRun);

  Length              = BlockSize - UnderRun;
  TransactionComplete = FALSE;

  Status              = EFI_SUCCESS;
  if (UnderRun != 0) {
    //
    // Offset starts in the middle of an Lba, so read the entire block.
    //
    Status = BlockIo->ReadBlocks (
                        BlockIo,
                        MediaId,
                        Lba,
                        BlockSize,
                        Data
                        );

    if (EFI_ERROR (Status)) {
      goto Done;
    }

    if (Length > BufferSize) {
      Length              = BufferSize;
      TransactionComplete = TRUE;
    }

    CopyMem (WorkingBuffer, Data + UnderRun, Length);

    WorkingBuffer += Length;

    WorkingBufferSize -= Length;
    if (WorkingBufferSize == 0) {
      goto Done;
    }

    Lba += 1;
  }

  OverRunLba = Lba + DivU64x32Remainder (WorkingBufferSize, BlockSize, &OverRun);

  if (!TransactionComplete && WorkingBufferSize >= BlockSize) {
    //
    // If the DiskIo maps directly to a BlockIo device do the read.
    //
    if (OverRun != 0) {
      WorkingBufferSize -= OverRun;
    }
    //
    // Check buffer alignment
    //
    IsBufferAligned = (UINTN) WorkingBuffer & (UINTN) (Media->IoAlign - 1);

    if (Media->IoAlign <= 1 || IsBufferAligned == 0) {
      //
      // Alignment is satisfied, so read them together
      //
      Status = BlockIo->ReadBlocks (
                          BlockIo,
                          MediaId,
                          Lba,
                          WorkingBufferSize,
                          WorkingBuffer
                          );

      if (EFI_ERROR (Status)) {
        goto Done;
      }

      WorkingBuffer += WorkingBufferSize;

    } else {
      //
      // Use the allocated buffer instead of the original buffer
      // to avoid alignment issue.
      // Here, the allocated buffer (8-byte align) can satisfy the alignment
      //
      LastRead = FALSE;
      do {
        if (WorkingBufferSize <= DataBufferSize) {
          //
          // It is the last calling to readblocks in this loop
          //
          DataBufferSize  = WorkingBufferSize;
          LastRead        = TRUE;
        }

        Status = BlockIo->ReadBlocks (
                            BlockIo,
                            MediaId,
                            Lba,
                            DataBufferSize,
                            Data
                            );
        if (EFI_ERROR (Status)) {
          goto Done;
        }

        CopyMem (WorkingBuffer, Data, DataBufferSize);
        WorkingBufferSize -= DataBufferSize;
        WorkingBuffer += DataBufferSize;
        Lba += DATA_BUFFER_BLOCK_NUM;
      } while (!LastRead);
    }
  }

  if (!TransactionComplete && OverRun != 0) {
    //
    // Last read is not a complete block.
    //
    Status = BlockIo->ReadBlocks (
                        BlockIo,
                        MediaId,
                        OverRunLba,
                        BlockSize,
                        Data
                        );

    if (EFI_ERROR (Status)) {
      goto Done;
    }

    CopyMem (WorkingBuffer, Data, OverRun);
  }

Done:
  if (PreData != NULL) {
    FreePool (PreData);
  }

  return Status;
}


/**
  Writes BufferSize bytes from Buffer into Offset.
  Writes may require a read modify write to support writes that are not
  aligned on sector boundaries. There are three cases:
    UnderRun - The first byte is not on a sector boundary or the write request
               is less than a sector in length. Read modify write is required.
    Aligned  - A write of N contiguous sectors.
    OverRun  - The last byte is not on a sector boundary. Read modified write
               required.

  @param  This       Protocol instance pointer.
  @param  MediaId    Id of the media, changes every time the media is replaced.
  @param  Offset     The starting byte offset to read from
  @param  BufferSize Size of Buffer
  @param  Buffer     Buffer containing read data

  @retval EFI_SUCCESS           The data was written correctly to the device.
  @retval EFI_WRITE_PROTECTED   The device can not be written to.
  @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.
  @retval EFI_NO_MEDIA          There is no media in the device.
  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.
  @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not
                                 valid for the device.

**/
EFI_STATUS
EFIAPI
DiskIoWriteDisk (
  IN EFI_DISK_IO_PROTOCOL  *This,
  IN UINT32                MediaId,
  IN UINT64                Offset,
  IN UINTN                 BufferSize,
  IN VOID                  *Buffer
  )
{
  EFI_STATUS            Status;
  DISK_IO_PRIVATE_DATA  *Private;
  EFI_BLOCK_IO_PROTOCOL *BlockIo;
  EFI_BLOCK_IO_MEDIA    *Media;
  UINT32                BlockSize;
  UINT64                Lba;
  UINT64                OverRunLba;
  UINT32                UnderRun;
  UINT32                OverRun;
  BOOLEAN               TransactionComplete;
  UINTN                 WorkingBufferSize;
  UINT8                 *WorkingBuffer;
  UINTN                 Length;
  UINT8                 *Data;
  UINT8                 *PreData;
  UINTN                 IsBufferAligned;
  UINTN                 DataBufferSize;
  BOOLEAN               LastWrite;

  Private   = DISK_IO_PRIVATE_DATA_FROM_THIS (This);

  BlockIo   = Private->BlockIo;
  Media     = BlockIo->Media;
  BlockSize = Media->BlockSize;

  if (Media->ReadOnly) {
    return EFI_WRITE_PROTECTED;
  }

  if (Media->MediaId != MediaId) {
    return EFI_MEDIA_CHANGED;
  }

  DataBufferSize = BlockSize * DATA_BUFFER_BLOCK_NUM;

  if (Media->IoAlign > 1) {
    PreData = AllocatePool (DataBufferSize + Media->IoAlign);
    Data    = PreData - ((UINTN) PreData & (Media->IoAlign - 1)) + Media->IoAlign;
  } else {
    PreData = AllocatePool (DataBufferSize);
    Data    = PreData;
  }

  if (PreData == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }

  WorkingBuffer       = Buffer;
  WorkingBufferSize   = BufferSize;

  Lba                 = DivU64x32Remainder (Offset, BlockSize, &UnderRun);

  Length              = BlockSize - UnderRun;
  TransactionComplete = FALSE;

  Status              = EFI_SUCCESS;
  if (UnderRun != 0) {
    //
    // Offset starts in the middle of an Lba, so do read modify write.
    //
    Status = BlockIo->ReadBlocks (
                        BlockIo,
                        MediaId,
                        Lba,
                        BlockSize,
                        Data
                        );

    if (EFI_ERROR (Status)) {
      goto Done;
    }

    if (Length > BufferSize) {
      Length              = BufferSize;
      TransactionComplete = TRUE;
    }

    CopyMem (Data + UnderRun, WorkingBuffer, Length);

    Status = BlockIo->WriteBlocks (
                        BlockIo,
                        MediaId,
                        Lba,
                        BlockSize,
                        Data
                        );
    if (EFI_ERROR (Status)) {
      goto Done;
    }

    WorkingBuffer += Length;
    WorkingBufferSize -= Length;
    if (WorkingBufferSize == 0) {
      goto Done;
    }

    Lba += 1;
  }

  OverRunLba = Lba + DivU64x32Remainder (WorkingBufferSize, BlockSize, &OverRun);

  if (!TransactionComplete && WorkingBufferSize >= BlockSize) {
    //
    // If the DiskIo maps directly to a BlockIo device do the write.
    //
    if (OverRun != 0) {
      WorkingBufferSize -= OverRun;
    }
    //
    // Check buffer alignment
    //
    IsBufferAligned = (UINTN) WorkingBuffer & (UINTN) (Media->IoAlign - 1);

    if (Media->IoAlign <= 1 || IsBufferAligned == 0) {
      //
      // Alignment is satisfied, so write them together
      //
      Status = BlockIo->WriteBlocks (
                          BlockIo,
                          MediaId,
                          Lba,
                          WorkingBufferSize,
                          WorkingBuffer
                          );

      if (EFI_ERROR (Status)) {
        goto Done;
      }

      WorkingBuffer += WorkingBufferSize;

    } else {
      //
      // The buffer parameter is not aligned with the request
      // So use the allocated instead.
      // It can fit almost all the cases.
      //
      LastWrite = FALSE;
      do {
        if (WorkingBufferSize <= DataBufferSize) {
          //
          // It is the last calling to writeblocks in this loop
          //
          DataBufferSize  = WorkingBufferSize;
          LastWrite       = TRUE;
        }

        CopyMem (Data, WorkingBuffer, DataBufferSize);
        Status = BlockIo->WriteBlocks (
                            BlockIo,
                            MediaId,
                            Lba,
                            DataBufferSize,
                            Data
                            );
        if (EFI_ERROR (Status)) {
          goto Done;
        }

        WorkingBufferSize -= DataBufferSize;
        WorkingBuffer += DataBufferSize;
        Lba += DATA_BUFFER_BLOCK_NUM;
      } while (!LastWrite);
    }
  }

  if (!TransactionComplete && OverRun != 0) {
    //
    // Last bit is not a complete block, so do a read modify write.
    //
    Status = BlockIo->ReadBlocks (
                        BlockIo,
                        MediaId,
                        OverRunLba,
                        BlockSize,
                        Data
                        );

    if (EFI_ERROR (Status)) {
      goto Done;
    }

    CopyMem (Data, WorkingBuffer, OverRun);

    Status = BlockIo->WriteBlocks (
                        BlockIo,
                        MediaId,
                        OverRunLba,
                        BlockSize,
                        Data
                        );
    if (EFI_ERROR (Status)) {
      goto Done;
    }
  }

Done:
  if (PreData != NULL) {
    FreePool (PreData);
  }

  return Status;
}


/**
  Retrieves the health status of a controller in the platform.  This function can also 
  optionally return warning messages, error messages, and a set of HII Forms that may 
  be repair a controller that is not proper configured. 
  
  @param  This             A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.

  @param  ControllerHandle The handle of the controller to retrieve the health status 
                           on.  This is an optional parameter that may be NULL.  If 
                           this parameter is NULL, then the value of ChildHandle is 
                           ignored, and the combined health status of all the devices 
                           that the driver is managing is returned.

  @param  ChildHandle      The handle of the child controller to retrieve the health 
                           status on.  This is an optional parameter that may be NULL.  
                           This parameter is ignored of ControllerHandle is NULL.  It 
                           will be NULL for device drivers.  It will also be NULL for 
                           bus drivers when an attempt is made to collect the health 
                           status of the bus controller.  If will not be NULL when an 
                           attempt is made to collect the health status for a child 
                           controller produced by the driver.

  @param  HealthStatus     A pointer to the health status that is returned by this 
                           function.  This is an optional parameter that may be NULL.  
                           This parameter is ignored of ControllerHandle is NULL.  
                           The health status for the controller specified by 
                           ControllerHandle and ChildHandle is returned. 

  @param  MessageList      A pointer to an array of warning or error messages associated 
                           with the controller specified by ControllerHandle and 
                           ChildHandle.  This is an optional parameter that may be NULL.  
                           MessageList is allocated by this function with the EFI Boot 
                           Service AllocatePool(), and it is the caller's responsibility 
                           to free MessageList with the EFI Boot Service FreePool().  
                           Each message is specified by tuple of an EFI_HII_HANDLE and 
                           an EFI_STRING_ID.  The array of messages is terminated by tuple 
                           containing a EFI_HII_HANDLE with a value of NULL.  The 
                           EFI_HII_STRING_PROTOCOL.GetString() function can be used to 
                           retrieve the warning or error message as a Null-terminated 
                           Unicode string in a specific language.  Messages may be 
                           returned for any of the HealthStatus values except 
                           EfiDriverHealthStatusReconnectRequired and 
                           EfiDriverHealthStatusRebootRequired.

  @param  FormHiiHandle    A pointer to the HII handle for an HII form associated with the 
                           controller specified by ControllerHandle and ChildHandle.  
                           This is an optional parameter that may be NULL.  An HII form 
                           is specified by a combination of an EFI_HII_HANDLE and an 
                           EFI_GUID that identifies the Form Set GUID.  The 
                           EFI_FORM_BROWSER2_PROTOCOL.SendForm() function can be used 
                           to display and allow the user to make configuration changes 
                           to the HII Form.  An HII form may only be returned with a 
                           HealthStatus value of EfiDriverHealthStatusConfigurationRequired.

  @retval EFI_SUCCESS           ControllerHandle is NULL, and all the controllers 
                                managed by this driver specified by This have a health 
                                status of EfiDriverHealthStatusHealthy with no warning 
                                messages to be returned.  The ChildHandle, HealthStatus, 
                                MessageList, and FormList parameters are ignored.

  @retval EFI_DEVICE_ERROR      ControllerHandle is NULL, and one or more of the 
                                controllers managed by this driver specified by This 
                                do not have a health status of EfiDriverHealthStatusHealthy.  
                                The ChildHandle, HealthStatus, MessageList, and 
                                FormList parameters are ignored.

  @retval EFI_DEVICE_ERROR      ControllerHandle is NULL, and one or more of the 
                                controllers managed by this driver specified by This 
                                have one or more warning and/or error messages.  
                                The ChildHandle, HealthStatus, MessageList, and 
                                FormList parameters are ignored.

  @retval EFI_SUCCESS           ControllerHandle is not NULL and the health status 
                                of the controller specified by ControllerHandle and 
                                ChildHandle was returned in HealthStatus.  A list 
                                of warning and error messages may be optionally 
                                returned in MessageList, and a list of HII Forms 
                                may be optionally returned in FormList.

  @retval EFI_UNSUPPORTED	      ControllerHandle is not NULL, and the controller 
                                specified by ControllerHandle and ChildHandle is not 
                                currently being managed by the driver specified by This.

  @retval EFI_INVALID_PARAMETER	HealthStatus is NULL.

  @retval EFI_OUT_OF_RESOURCES	MessageList is not NULL, and there are not enough 
                                resource available to allocate memory for MessageList.

**/
EFI_STATUS
DiskIoDriverHealthGetHealthStatus (
  IN  EFI_DRIVER_HEALTH_PROTOCOL       *This,
  IN  EFI_HANDLE                       ControllerHandle  OPTIONAL,
  IN  EFI_HANDLE                       ChildHandle       OPTIONAL,
  OUT EFI_DRIVER_HEALTH_STATUS         *HealthStatus,
  OUT EFI_DRIVER_HEALTH_HII_MESSAGE    **MessageList     OPTIONAL,
  OUT EFI_HII_HANDLE                   *FormHiiHandle    OPTIONAL
  )
{
  EFI_STATUS            Status;
  EFI_DISK_IO_PROTOCOL  *DiskIo;
  DISK_IO_PRIVATE_DATA  *Private;
  DEVICE_STATE          *DeviceState;
  CONTROLLER_STATE      *ControllerState;
  LIST_ENTRY            *Link;
  UINTN                 BufferSize;

  ControllerState   = NULL;
  DeviceState       = NULL;

  if (HealthStatus == NULL) {
    return EFI_INVALID_PARAMETER;
  }

  if (ControllerHandle == NULL) {
    *HealthStatus = EfiDriverHealthStatusHealthy;
    if (mNumNotHealthy != 0) {
      *HealthStatus = EfiDriverHealthStatusFailed;
    }
    return EFI_SUCCESS;
  }

  //
  // This is a device driver, so ChildHandle must be NULL.
  //
  if (ChildHandle != NULL) {
    return EFI_UNSUPPORTED;
  }
  //
  // Make sure this driver is currently managing ControllerHandle
  //
  Status = EfiTestManagedDevice (
             ControllerHandle,
             gDiskIoDriverBinding.DriverBindingHandle,
             &gEfiBlockIoProtocolGuid
             );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  if (HealthStatus == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Status = gBS->HandleProtocol (ControllerHandle, &gEfiDiskIoProtocolGuid, (VOID **) &DiskIo);
  if (EFI_ERROR (Status)) {
    return EFI_UNSUPPORTED;
  }

  if (HealthStatus == NULL) {
    return EFI_INVALID_PARAMETER;
  }

  Private = DISK_IO_PRIVATE_DATA_FROM_THIS (DiskIo);


  //
  // Get the Controller State from global list
  //
  Link = GetFirstNode (&mControllerList);

  while (!IsNull (&mControllerList, Link)) {
    ControllerState = DISK_IO_CONTROLLER_STATE_FROM_LINK (Link);

    if (ControllerState->ControllerHandle == ControllerHandle) {
      DeviceState = GetDeviceState (ControllerState->DeviceStateNum);
      break;
    }
    Link = GetNextNode (&mControllerList, Link);
  }

  ASSERT (DeviceState != NULL);

  if (DeviceState->HealthStatus == EfiDriverHealthStatusConfigurationRequired) {
    
    //
    // Read the configuration for this device
    //
    BufferSize = sizeof (Private->NVdata.ConfigGood);
    Status = gRT->GetVariable (
                    L"Config",
                    &gEfiCallerIdGuid,
                    NULL,
                    &BufferSize,
                    &Private->NVdata.ConfigGood
                    );
    ASSERT_EFI_ERROR (Status);

    //
    // If the config value is 1, then the configuration is valid and the state machine can move to the next state
    // Otherwise, the state machine returns ConfigurationRequired again
    //
    if (Private->NVdata.ConfigGood == ControllerState->ControllerIndex) {
      if (DeviceState->HealthStatus != EfiDriverHealthStatusHealthy || DeviceState->StringId != 0) {
        mNumNotHealthy--;
      }

      ControllerState->DeviceStateNum = DeviceState->NextState;

      DeviceState = GetDeviceState (ControllerState->DeviceStateNum);
      ASSERT (DeviceState != NULL);

      if (DeviceState->HealthStatus != EfiDriverHealthStatusHealthy) {
        mNumNotHealthy++;
      }
    }
  }    
  
  *HealthStatus = DeviceState->HealthStatus;

  if (MessageList != NULL) {
    *MessageList = NULL;
    if (DeviceState->StringId != 0) {
      *MessageList = AllocateZeroPool (sizeof(EFI_DRIVER_HEALTH_HII_MESSAGE) * 2);
      if (*MessageList == NULL) {
        return EFI_UNSUPPORTED;
      }
      (*MessageList)[0].HiiHandle = mHiiHandle;
      (*MessageList)[0].StringId  = DeviceState->StringId;
    } else {
      *MessageList = AllocateZeroPool (sizeof(EFI_DRIVER_HEALTH_HII_MESSAGE) * 1);
      if (*MessageList == NULL) {
        return EFI_UNSUPPORTED;
      }
    }
  }
  if (FormHiiHandle != NULL) {
    *FormHiiHandle = mHiiHandle;
  }

  if (DeviceState->HealthStatus == EfiDriverHealthStatusConfigurationRequired) {
    Private->NVdata.ConfigGood = 0;
    Status = gRT->SetVariable (
                    L"Config",
                    &gEfiCallerIdGuid,
                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                    sizeof (Private->NVdata.ConfigGood),
                    &Private->NVdata.ConfigGood
                    );
    ASSERT_EFI_ERROR (Status);
  }

  return EFI_SUCCESS;
}

/**
  Performs a repair operation on a controller in the platform.  This function can 
  optionally report repair progress information back to the platform. 
  
  @param  This             A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.
  @param  ControllerHandle The handle of the controller to repair.
  @param  ChildHandle      The handle of the child controller to repair.  This is 
                           an optional parameter that may be NULL.  It will be NULL 
                           for device drivers.  It will also be NULL for bus 
                           drivers when an attempt is made to repair a bus controller.
                           If will not be NULL when an attempt is made to repair a 
                           child controller produced by the driver.
  @param  RepairNotify     A notification function that may be used by a driver to 
                           report the progress of the repair operation.  This is 
                           an optional parameter that may be NULL.  


  @retval EFI_SUCCESS	          An attempt to repair the controller specified by 
                                ControllerHandle and ChildHandle was performed.  
                                The result of the repair operation can be 
                                determined by calling GetHealthStatus().
  @retval EFI_UNSUPPORTED	      The driver specified by This is not currently 
                                managing the controller specified by ControllerHandle 
                                and ChildHandle.
  @retval EFI_OUT_OF_RESOURCES	There are not enough resources to perform the 
                                repair operation.

*/
EFI_STATUS
DiskIoDriverHealthRepair (
  IN  EFI_DRIVER_HEALTH_PROTOCOL                *This,
  IN  EFI_HANDLE                                ControllerHandle,
  IN  EFI_HANDLE                                ChildHandle       OPTIONAL,
  IN  EFI_DRIVER_HEALTH_REPAIR_PROGRESS_NOTIFY  RepairNotify      OPTIONAL
  )
{
  EFI_STATUS            Status;
  UINTN                 Index;
  DEVICE_STATE          *DeviceState;
  CONTROLLER_STATE      *ControllerState;
  LIST_ENTRY            *Link;
  EFI_DISK_IO_PROTOCOL  *DiskIo;
  DISK_IO_PRIVATE_DATA  *Private;

  Index           = 0;
  ControllerState = NULL;
  DeviceState     = NULL;
  //
  // This is a device driver, so ChildHandle must be NULL.
  //
  if (ChildHandle != NULL) {
    return EFI_UNSUPPORTED;
  }
  //
  // Make sure this driver is currently managing ControllerHandle
  //
  Status = EfiTestManagedDevice (
             ControllerHandle,
             gDiskIoDriverBinding.DriverBindingHandle,
             &gEfiBlockIoProtocolGuid
             );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  Status = gBS->HandleProtocol (ControllerHandle, &gEfiDiskIoProtocolGuid, (VOID **) &DiskIo);
  if (EFI_ERROR (Status)) {
    return EFI_UNSUPPORTED;
  }

  Private = DISK_IO_PRIVATE_DATA_FROM_THIS (DiskIo);

  Link = GetFirstNode (&mControllerList);

  while (!IsNull (&mControllerList, Link)) {
    ControllerState = DISK_IO_CONTROLLER_STATE_FROM_LINK (Link);

    if (ControllerState->ControllerHandle == ControllerHandle) {
      DeviceState = GetDeviceState (ControllerState->DeviceStateNum);
      break;
    }
    Link = GetNextNode (&mControllerList, Link);
  }

  ASSERT (DeviceState != NULL);
  //
  // Check to see if the controller has already been repaired
  //
  if (DeviceState->HealthStatus != EfiDriverHealthStatusRepairRequired) {
    return EFI_SUCCESS;
  }

  if (DeviceState->RepairNotify) {
    do {
      RepairNotify(Index, 10);
      Index++;
    } while ((gBS->Stall(100000) == EFI_SUCCESS) && (Index < 10));
  }

  if (DeviceState->HealthStatus != EfiDriverHealthStatusHealthy || DeviceState->StringId != 0) {
    mNumNotHealthy--;
  }
  
  //
  // Repair success, go to next state
  //
  ControllerState->DeviceStateNum = DeviceState->NextState;

  DeviceState = GetDeviceState (ControllerState->DeviceStateNum);
  ASSERT (DeviceState != NULL);

  if (DeviceState->HealthStatus != EfiDriverHealthStatusHealthy || DeviceState->StringId != 0) {
    mNumNotHealthy++;
  }

  if (DeviceState->HealthStatus == EfiDriverHealthStatusConfigurationRequired) {
    Private->NVdata.ConfigGood = 0;
    Status = gRT->SetVariable (
                    L"Config",
                    &gEfiCallerIdGuid,
                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                    sizeof (Private->NVdata.ConfigGood),
                    &Private->NVdata.ConfigGood
                    );
    ASSERT_EFI_ERROR (Status);
  }

  return EFI_SUCCESS;
}

/**
  The user Entry Point for module DiskIo. The user code starts with this function.

  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  
  @param[in] SystemTable    A pointer to the EFI System Table.
  
  @retval EFI_SUCCESS       The entry point is executed successfully.
  @retval other             Some error occurs when executing this entry point.

**/
EFI_STATUS
EFIAPI
InitializeDiskIo (
  IN EFI_HANDLE           ImageHandle,
  IN EFI_SYSTEM_TABLE     *SystemTable
  )
{
  EFI_STATUS        Status;
  //
  // Install driver model protocol(s).
  //
  Status = EfiLibInstallDriverBindingComponentName2 (
           ImageHandle,
           SystemTable,
           &gDiskIoDriverBinding,
           ImageHandle,
           &gDiskIoComponentName,
           &gDiskIoComponentName2
           );

  ASSERT_EFI_ERROR (Status);

  Status = gBS->InstallProtocolInterface (
                  &ImageHandle,
                  &gEfiDriverHealthProtocolGuid,
                  EFI_NATIVE_INTERFACE,
                  &gDiskIoDriverHealth
                  );
  ASSERT_EFI_ERROR (Status);

  InitializeListHead (&mControllerList);

  gDiskIoPrivateDataTemplate.Handle = ImageHandle;
  Status = DiskIoConfigFormInit ();

  ASSERT_EFI_ERROR (Status);

  return Status;
}

/**
  Initialize the serial configuration form.

  @retval EFI_SUCCESS              The serial configuration form is initialized.
  @retval EFI_OUT_OF_RESOURCES     Failed to allocate memory.
  @retval Others                   Other errors as indicated.
**/
EFI_STATUS
DiskIoConfigFormInit (
  VOID
  )
{
  EFI_STATUS                       Status;

  //
  // Locate Hii Database protocol
  //
  Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **)&gDiskIoPrivateDataTemplate.HiiDatabase);
  if (EFI_ERROR (Status)) {
    return Status;
  }

  Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **)&gDiskIoPrivateDataTemplate.HiiConfigRouting);
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Install Device Path Protocol and Config Access protocol to driver handle
  //
  Status = gBS->InstallMultipleProtocolInterfaces (
    &gDiskIoPrivateDataTemplate.Handle,
    &gEfiDevicePathProtocolGuid, &mHiiVendorDevicePathDiskIoDummy,
    &gEfiHiiConfigAccessProtocolGuid, &gDiskIoPrivateDataTemplate.ConfigAccess,
    NULL
    );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Publish our HII data
  //
  mHiiHandle = HiiAddPackages (
    &gEfiCallerIdGuid,
    gDiskIoPrivateDataTemplate.Handle,
    DriverHealthDxeStrings,
    DriverHealthVfrBin,
    NULL
    );
  if (mHiiHandle == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }

  return EFI_SUCCESS;
}
/**
  This function processes the results of changes in configuration.

  @param  This                   Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  @param  Action                 Specifies the type of action taken by the browser.
  @param  QuestionId             A unique value which is sent to the original
                                 exporting driver so that it can identify the type
                                 of data to expect.
  @param  Type                   The type of value for the question.
  @param  Value                  A pointer to the data being sent to the original
                                 exporting driver.
  @param  ActionRequest          On return, points to the action requested by the
                                 callback function.

  @retval EFI_SUCCESS            The callback successfully handled the action.
  @retval EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the
                                 variable and its data.
  @retval EFI_DEVICE_ERROR       The variable could not be saved.
  @retval EFI_UNSUPPORTED        The specified Action is not supported by the
                                 callback.

**/
EFI_STATUS
EFIAPI
DummyDriverCallback (
  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
  IN  EFI_BROWSER_ACTION                     Action,
  IN  EFI_QUESTION_ID                        QuestionId,
  IN  UINT8                                  Type,
  IN  EFI_IFR_TYPE_VALUE                     *Value,
  OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest
  )
{

  DISK_IO_NV_DATA  *IfrNvData;

  //
  // Retrieve uncommitted data from Browser
  //

  IfrNvData = AllocateZeroPool (sizeof (DISK_IO_NV_DATA));
  ASSERT (IfrNvData != NULL);

  if (!HiiGetBrowserData (&gEfiCallerIdGuid, VariableName, sizeof (DISK_IO_NV_DATA), (UINT8 *) IfrNvData)) {
    FreePool (IfrNvData);
    return EFI_NOT_FOUND;
  }

  if ((Value == NULL) || (ActionRequest == NULL)) {
    return EFI_INVALID_PARAMETER;
  }

  *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;


  return EFI_SUCCESS;
}

/**
  This function allows a caller to extract the current configuration for one
  or more named elements from the target driver.

  @param  This                   Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  @param  Request                A null-terminated Unicode string in
                                 <ConfigRequest> format.
  @param  Progress               On return, points to a character in the Request
                                 string. Points to the string's null terminator if
                                 request was successful. Points to the most recent
                                 '&' before the first failing name/value pair (or
                                 the beginning of the string if the failure is in
                                 the first name/value pair) if the request was not
                                 successful.
  @param  Results                A null-terminated Unicode string in
                                 <ConfigAltResp> format which has all values filled
                                 in for the names in the Request string. String to
                                 be allocated by the called function.

  @retval EFI_SUCCESS            The Results is filled with the requested values.
  @retval EFI_OUT_OF_RESOURCES   Not enough memory to store the results.
  @retval EFI_INVALID_PARAMETER  Request is NULL, illegal syntax, or unknown name.
  @retval EFI_NOT_FOUND          Routing data doesn't match any storage in this
                                 driver.

**/
EFI_STATUS
EFIAPI
DummyExtractConfig (
  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
  IN  CONST EFI_STRING                       Request,
  OUT EFI_STRING                             *Progress,
  OUT EFI_STRING                             *Results
  )
{
  EFI_STATUS                       Status;
  UINTN                            BufferSize;
  DISK_IO_PRIVATE_DATA             *PrivateData;
  EFI_HII_CONFIG_ROUTING_PROTOCOL  *HiiConfigRouting;
  EFI_STRING                       ConfigRequest;
  EFI_STRING                       ConfigRequestHdr;
  UINTN                            Size;
  
  if (Progress == NULL || Results == NULL || Request == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  //
  // Initialize the local variables.
  //
  ConfigRequestHdr  = NULL;
  ConfigRequest     = NULL;
  Size              = 0;
  *Progress         = Request;

  PrivateData = DISK_IO_PRIVATE_DATA_FROM_CONFIG_ACCESS(This);
  HiiConfigRouting = PrivateData->HiiConfigRouting;

  //
  // Get Buffer Storage data from EFI variable.
  // Try to get the current setting from variable.
  //
  BufferSize = sizeof (DISK_IO_NV_DATA);
  Status = gRT->GetVariable (
            VariableName,
            &gEfiCallerIdGuid,
            NULL,
            &BufferSize,
            &PrivateData->NVdata
            );
  if (EFI_ERROR (Status)) {
    return EFI_NOT_FOUND;
  }
  
  if (Request == NULL) {
    //
    // Request is set to NULL, construct full request string.
    //

    //
    // Allocate and fill a buffer large enough to hold the <ConfigHdr> template 
    // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator
    //
    ConfigRequestHdr = HiiConstructConfigHdr (&gEfiCallerIdGuid, VariableName, PrivateData->Handle);
    Size = (StrLen (ConfigRequest) + 32 + 1) * sizeof (CHAR16);
    ConfigRequest = AllocateZeroPool (Size);
    UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);
    FreePool (ConfigRequestHdr);
  } else {
    //
    // Check routing data in <ConfigHdr>.
    // Note: if only one Storage is used, then this checking could be skipped.
    //
    if (!HiiIsConfigHdrMatch (Request, &gEfiCallerIdGuid, VariableName)) {
      return EFI_NOT_FOUND;
    }
    ConfigRequest = Request;
  }

  //
  // Convert buffer data to <ConfigResp> by helper function BlockToConfig()
  //
  Status = HiiConfigRouting->BlockToConfig (
                                HiiConfigRouting,
                                ConfigRequest,
                                (UINT8 *) &PrivateData->NVdata,
                                BufferSize,
                                Results,
                                Progress
                                );
  
  if (Request == NULL) {
    FreePool (ConfigRequest);
    *Progress = NULL;
  }

  return Status;
}

/**
  This function processes the results of changes in configuration.

  @param  This                   Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  @param  Configuration          A null-terminated Unicode string in <ConfigResp>
                                 format.
  @param  Progress               A pointer to a string filled in with the offset of
                                 the most recent '&' before the first failing
                                 name/value pair (or the beginning of the string if
                                 the failure is in the first name/value pair) or
                                 the terminating NULL if all was successful.

  @retval EFI_SUCCESS            The Results is processed successfully.
  @retval EFI_INVALID_PARAMETER  Configuration is NULL.
  @retval EFI_NOT_FOUND          Routing data doesn't match any storage in this
                                 driver.

**/
EFI_STATUS
EFIAPI
DummyRouteConfig (
  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
  IN  CONST EFI_STRING                       Configuration,
  OUT EFI_STRING                             *Progress
  )
{
  EFI_STATUS                       Status;
  UINTN                            BufferSize;
  DISK_IO_PRIVATE_DATA             *PrivateData;
  EFI_HII_CONFIG_ROUTING_PROTOCOL  *HiiConfigRouting;

  if (Configuration == NULL || Progress == NULL) {
    return EFI_INVALID_PARAMETER;
  }


  PrivateData = DISK_IO_PRIVATE_DATA_FROM_CONFIG_ACCESS (This);
  HiiConfigRouting = PrivateData->HiiConfigRouting;
  *Progress = Configuration;

  //
  // Check routing data in <ConfigHdr>.
  // Note: if only one Storage is used, then this checking could be skipped.
  //
  if (!HiiIsConfigHdrMatch (Configuration, &gEfiCallerIdGuid, VariableName)) {
    return EFI_NOT_FOUND;
  }

  //
  // Get Buffer Storage data from EFI variable
  //
  BufferSize = sizeof (DISK_IO_NV_DATA);
  Status = gRT->GetVariable (
            VariableName,
            &gEfiCallerIdGuid,
            NULL,
            &BufferSize,
            &PrivateData->NVdata
            );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Convert <ConfigResp> to buffer data by helper function ConfigToBlock()
  //
  BufferSize = sizeof (DISK_IO_NV_DATA);
  Status = HiiConfigRouting->ConfigToBlock (
                               HiiConfigRouting,
                               Configuration,
                               (UINT8 *) &PrivateData->NVdata,
                               &BufferSize,
                               Progress
                               );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Store Buffer Storage back to EFI variable
  //
  Status = gRT->SetVariable(
                  VariableName,
                  &gEfiCallerIdGuid,
                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                  sizeof (DISK_IO_NV_DATA),
                  &PrivateData->NVdata
                  );

  return Status;
}