summaryrefslogtreecommitdiff
path: root/packages/linux/linux-storcenter/kernel.patch-2.6.12.6
blob: 094b7e14e92324637153e232a12cb62139d4be9c (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
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
diff -urN linux-original/arch/ppc/Kconfig linux/arch/ppc/Kconfig
--- linux-original/arch/ppc/Kconfig	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/Kconfig	2005-07-08 08:55:27.000000000 -0400
@@ -628,6 +628,15 @@
 	  End of Life: -
 	  URL: <http://www.windriver.com/>
 
+config IOMEGA8241
+	bool "IOMEGA8241"
+	---help---
+	  Iomega StorCenter Network Hard Drive
+	  Manufacturer: Iomega Corporation
+	  Date of Release: May 2005
+	  End of Life: -
+	  URL: <http://www.iomega.com/>
+
 config SBS8260
 	bool "SBS8260"
 
@@ -755,7 +764,7 @@
 	depends on SANDPOINT || MCPN765 || SPRUCE || PPLUS || PCORE || \
 		PRPMC750 || K2 || PRPMC800 || LOPEC || \
 		(EV64260 && !SERIAL_MPSC) || CHESTNUT || RADSTONE_PPC7D || \
-		83xx
+		83xx || IOMEGA8241
 	default y
 
 config FORCE
@@ -823,7 +832,7 @@
 
 config MPC10X_BRIDGE
 	bool
-	depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT
+	depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT || IOMEGA8241
 	default y
 
 config FSL_OCP
@@ -833,7 +842,7 @@
 
 config MPC10X_OPENPIC
 	bool
-	depends on POWERPMC250 || LOPEC || SANDPOINT
+	depends on POWERPMC250 || LOPEC || SANDPOINT || IOMEGA8241
 	default y
 
 config MPC10X_STORE_GATHERING
diff -urN linux-original/arch/ppc/boot/Makefile linux/arch/ppc/boot/Makefile
--- linux-original/arch/ppc/boot/Makefile	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/boot/Makefile	2005-07-08 08:55:27.000000000 -0400
@@ -13,7 +13,7 @@
 CFLAGS	 	+= -fno-builtin -D__BOOTER__ -Iarch/$(ARCH)/boot/include
 HOSTCFLAGS	+= -Iarch/$(ARCH)/boot/include
 
-BOOT_TARGETS	= zImage zImage.initrd znetboot znetboot.initrd
+BOOT_TARGETS	= zImage zImage.initrd znetboot znetboot.initrd uImage
 
 bootdir-y			:= simple
 bootdir-$(CONFIG_PPC_OF)	+= openfirmware
diff -urN linux-original/arch/ppc/boot/simple/Makefile linux/arch/ppc/boot/simple/Makefile
--- linux-original/arch/ppc/boot/simple/Makefile	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/boot/simple/Makefile	2005-07-08 08:55:27.000000000 -0400
@@ -135,6 +135,10 @@
          end-$(CONFIG_SANDPOINT)	:= sandpoint
    cacheflag-$(CONFIG_SANDPOINT)	:= -include $(clear_L2_L3)
 
+         end-$(CONFIG_IOMEGA8241)      := iomega8241
+   cacheflag-$(CONFIG_IOMEGA8241)      := -include $(clear_L2_L3)
+
+
       zimage-$(CONFIG_SPRUCE)		:= zImage-TREE
 zimageinitrd-$(CONFIG_SPRUCE)		:= zImage.initrd-TREE
          end-$(CONFIG_SPRUCE)		:= spruce
diff -urN linux-original/arch/ppc/configs/iomega8241_defconfig linux/arch/ppc/configs/iomega8241_defconfig
--- linux-original/arch/ppc/configs/iomega8241_defconfig	1969-12-31 19:00:00.000000000 -0500
+++ linux/arch/ppc/configs/iomega8241_defconfig	2005-08-08 13:13:35.000000000 -0400
@@ -0,0 +1,1094 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.12
+# Mon Jul 18 11:03:36 2005
+#
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_HOTPLUG=y
+# CONFIG_KOBJECT_UEVENT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Processor
+#
+CONFIG_6xx=y
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
+# CONFIG_8xx is not set
+# CONFIG_E500 is not set
+CONFIG_PPC_FPU=y
+# CONFIG_ALTIVEC is not set
+# CONFIG_TAU is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_PPC_GEN550=y
+# CONFIG_PM is not set
+CONFIG_PPC_STD_MMU=y
+
+#
+# Platform options
+#
+# CONFIG_PPC_MULTIPLATFORM is not set
+# CONFIG_APUS is not set
+# CONFIG_KATANA is not set
+# CONFIG_WILLOW is not set
+# CONFIG_CPCI690 is not set
+# CONFIG_PCORE is not set
+# CONFIG_POWERPMC250 is not set
+# CONFIG_CHESTNUT is not set
+# CONFIG_SPRUCE is not set
+# CONFIG_HDPU is not set
+# CONFIG_EV64260 is not set
+# CONFIG_LOPEC is not set
+# CONFIG_MCPN765 is not set
+# CONFIG_MVME5100 is not set
+# CONFIG_PPLUS is not set
+# CONFIG_PRPMC750 is not set
+# CONFIG_PRPMC800 is not set
+# CONFIG_SANDPOINT is not set
+# CONFIG_RADSTONE_PPC7D is not set
+# CONFIG_ADIR is not set
+# CONFIG_K2 is not set
+# CONFIG_PAL4 is not set
+# CONFIG_GEMINI is not set
+# CONFIG_EST8260 is not set
+# CONFIG_SBC82xx is not set
+CONFIG_IOMEGA8241=y
+# CONFIG_SBS8260 is not set
+# CONFIG_RPX8260 is not set
+# CONFIG_TQM8260 is not set
+# CONFIG_ADS8272 is not set
+# CONFIG_PQ2FADS is not set
+# CONFIG_LITE5200 is not set
+# CONFIG_MPC834x_SYS is not set
+CONFIG_MPC10X_BRIDGE=y
+CONFIG_FSL_OCP=y
+CONFIG_MPC10X_OPENPIC=y
+# CONFIG_MPC10X_STORE_GATHERING is not set
+# CONFIG_SMP is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=/dev/ttyS0,115200"
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_LEGACY_PROC is not set
+# CONFIG_PCI_NAMES is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_FTL=y
+CONFIG_NFTL=y
+CONFIG_NFTL_RW=y
+# CONFIG_INFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_CFI_AMDSTD_RETRY=0
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0xFF800000
+CONFIG_MTD_PHYSMAP_LEN=0x00800000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=1
+CONFIG_MTD_IOMEGA8241=y
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=1
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_LBD=y
+# CONFIG_CDROM_PKTCDVD is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+CONFIG_BLK_DEV_OFFBOARD=y
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+# CONFIG_BLK_DEV_SL82C105 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_PCI_AUTO is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+# CONFIG_CHR_DEV_SG is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_IP_TCPDIAG is not set
+# CONFIG_IP_TCPDIAG_IPV6 is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETFILTER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+# CONFIG_NET_ETHERNET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+CONFIG_R8169=y
+# CONFIG_R8169_NAPI is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_ISA is not set
+CONFIG_I2C_MPC=y
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=y
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+
+#
+# Other I2C Chip support
+#
+CONFIG_SENSORS_DS1337=y
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_RTC8564 is not set
+# CONFIG_SENSORS_M41T00 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_BLUETOOTH_TTY is not set
+# CONFIG_USB_ACM is not set
+CONFIG_USB_PRINTER=y
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_MON is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB ATM/DSL drivers
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=y
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+
+#
+# XFS support
+#
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+CONFIG_ROMFS_FS=y
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=y
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_XATTR is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS_FS=y
+CONFIG_JFFS_FS_VERBOSE=0
+CONFIG_JFFS_PROC_FS=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_FS_NAND is not set
+# CONFIG_JFFS2_FS_NOR_ECC is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SERIAL_TEXT_DEBUG=y
+CONFIG_PPC_OCP=y
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
diff -urN linux-original/arch/ppc/configs/iomega8241m_defconfig linux/arch/ppc/configs/iomega8241m_defconfig
--- linux-original/arch/ppc/configs/iomega8241m_defconfig	1969-12-31 19:00:00.000000000 -0500
+++ linux/arch/ppc/configs/iomega8241m_defconfig	2005-08-18 09:46:48.000000000 -0400
@@ -0,0 +1,1104 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.12
+# Mon Aug 15 10:22:39 2005
+#
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_HOTPLUG=y
+# CONFIG_KOBJECT_UEVENT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Processor
+#
+CONFIG_6xx=y
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
+# CONFIG_8xx is not set
+# CONFIG_E500 is not set
+CONFIG_PPC_FPU=y
+# CONFIG_ALTIVEC is not set
+# CONFIG_TAU is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_PPC_GEN550=y
+# CONFIG_PM is not set
+CONFIG_PPC_STD_MMU=y
+
+#
+# Platform options
+#
+# CONFIG_PPC_MULTIPLATFORM is not set
+# CONFIG_APUS is not set
+# CONFIG_KATANA is not set
+# CONFIG_WILLOW is not set
+# CONFIG_CPCI690 is not set
+# CONFIG_PCORE is not set
+# CONFIG_POWERPMC250 is not set
+# CONFIG_CHESTNUT is not set
+# CONFIG_SPRUCE is not set
+# CONFIG_HDPU is not set
+# CONFIG_EV64260 is not set
+# CONFIG_LOPEC is not set
+# CONFIG_MCPN765 is not set
+# CONFIG_MVME5100 is not set
+# CONFIG_PPLUS is not set
+# CONFIG_PRPMC750 is not set
+# CONFIG_PRPMC800 is not set
+# CONFIG_SANDPOINT is not set
+# CONFIG_RADSTONE_PPC7D is not set
+# CONFIG_ADIR is not set
+# CONFIG_K2 is not set
+# CONFIG_PAL4 is not set
+# CONFIG_GEMINI is not set
+# CONFIG_EST8260 is not set
+# CONFIG_SBC82xx is not set
+CONFIG_IOMEGA8241=y
+# CONFIG_SBS8260 is not set
+# CONFIG_RPX8260 is not set
+# CONFIG_TQM8260 is not set
+# CONFIG_ADS8272 is not set
+# CONFIG_PQ2FADS is not set
+# CONFIG_LITE5200 is not set
+# CONFIG_MPC834x_SYS is not set
+CONFIG_MPC10X_BRIDGE=y
+CONFIG_FSL_OCP=y
+CONFIG_MPC10X_OPENPIC=y
+# CONFIG_MPC10X_STORE_GATHERING is not set
+# CONFIG_SMP is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=/dev/ttyS0,115200"
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_LEGACY_PROC is not set
+# CONFIG_PCI_NAMES is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_FTL=y
+CONFIG_NFTL=y
+CONFIG_NFTL_RW=y
+# CONFIG_INFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_CFI_AMDSTD_RETRY=0
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0xFF800000
+CONFIG_MTD_PHYSMAP_LEN=0x00800000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=1
+CONFIG_MTD_IOMEGA8241=y
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=1
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_LBD=y
+# CONFIG_CDROM_PKTCDVD is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+CONFIG_BLK_DEV_OFFBOARD=y
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+# CONFIG_BLK_DEV_SL82C105 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_PCI_AUTO is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+# CONFIG_CHR_DEV_SG is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=y
+CONFIG_MD_RAID0=y
+CONFIG_MD_RAID1=y
+# CONFIG_MD_RAID10 is not set
+CONFIG_MD_RAID5=y
+# CONFIG_MD_RAID6 is not set
+# CONFIG_MD_MULTIPATH is not set
+# CONFIG_MD_FAULTY is not set
+# CONFIG_BLK_DEV_DM is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_IP_TCPDIAG is not set
+# CONFIG_IP_TCPDIAG_IPV6 is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETFILTER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+# CONFIG_NET_ETHERNET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+CONFIG_R8169=y
+# CONFIG_R8169_NAPI is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_ISA is not set
+CONFIG_I2C_MPC=y
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=y
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+
+#
+# Other I2C Chip support
+#
+CONFIG_SENSORS_DS1337=y
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_RTC8564 is not set
+# CONFIG_SENSORS_M41T00 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_BLUETOOTH_TTY is not set
+# CONFIG_USB_ACM is not set
+CONFIG_USB_PRINTER=y
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_MON is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB ATM/DSL drivers
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=y
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+
+#
+# XFS support
+#
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+CONFIG_ROMFS_FS=y
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=y
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_XATTR is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS_FS=y
+CONFIG_JFFS_FS_VERBOSE=0
+CONFIG_JFFS_PROC_FS=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_FS_NAND is not set
+# CONFIG_JFFS2_FS_NOR_ECC is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SERIAL_TEXT_DEBUG=y
+CONFIG_PPC_OCP=y
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
diff -urN linux-original/arch/ppc/kernel/Makefile linux/arch/ppc/kernel/Makefile
--- linux-original/arch/ppc/kernel/Makefile	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/kernel/Makefile	2005-07-08 08:55:27.000000000 -0400
@@ -31,4 +31,3 @@
 ifndef CONFIG_MATH_EMULATION
 obj-$(CONFIG_8xx)		+= softemu8xx.o
 endif
-
diff -urN linux-original/arch/ppc/platforms/Makefile linux/arch/ppc/platforms/Makefile
--- linux-original/arch/ppc/platforms/Makefile	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/platforms/Makefile	2005-07-08 08:55:27.000000000 -0400
@@ -44,6 +44,7 @@
 obj-$(CONFIG_RADSTONE_PPC7D)	+= radstone_ppc7d.o
 obj-$(CONFIG_SANDPOINT)		+= sandpoint.o
 obj-$(CONFIG_SBC82xx)		+= sbc82xx.o
+obj-$(CONFIG_IOMEGA8241)	+= iomega8241.o
 obj-$(CONFIG_SPRUCE)		+= spruce.o
 obj-$(CONFIG_LITE5200)		+= lite5200.o
 
diff -urN linux-original/arch/ppc/platforms/iomega8241.c linux/arch/ppc/platforms/iomega8241.c
--- linux-original/arch/ppc/platforms/iomega8241.c	1969-12-31 19:00:00.000000000 -0500
+++ linux/arch/ppc/platforms/iomega8241.c	2005-08-08 12:53:30.000000000 -0400
@@ -0,0 +1,567 @@
+/*
+ * arch/ppc/platforms/iomega8241.c
+ *
+ * The Iomega StorCenter Network Hard Drive platform is based on the
+ * original sandpoint test platform.  That GNU copyright information
+ * is reproduced below:
+ * 
+ * Board setup routines for the Motorola SPS Sandpoint Test Platform.
+ *
+ * Author: Mark A. Greer
+ *	 mgreer@mvista.com
+ *
+ * 2000-2003 (c) MontaVista Software, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+/*
+ * Iomega StorCenter Network Hard Drive.
+ * 
+ * Maintainer (Iomega Port): Anthony Russello
+ *   russello@iomega.com
+ * Much of the below code was taken from the original sandpoint.c/.h port
+ * done my Mark A. Greer (see above copyright information).  It was adapted
+ * to support a custom board.
+ */
+
+#include <linux/config.h>
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/reboot.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/initrd.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/irq.h>
+#include <linux/ide.h>
+#include <linux/seq_file.h>
+#include <linux/root_dev.h>
+#include <linux/serial.h>
+#include <linux/tty.h>	/* for linux/serial_core.h */
+#include <linux/serial_core.h>
+#include <linux/serialP.h>
+#include <linux/serial_reg.h>
+
+#include <asm/system.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <asm/time.h>
+#include <asm/dma.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/smp.h>
+#include <asm/vga.h>
+#include <asm/open_pic.h>
+#include <asm/i8259.h>
+#include <asm/todc.h>
+#include <asm/bootinfo.h>
+#include <asm/mpc10x.h>
+#include <asm/pci-bridge.h>
+#include <asm/kgdb.h>
+
+#include "iomega8241.h"
+
+static struct serial_state rs_table[RS_TABLE_SIZE] = {
+	SERIAL_PORT_DFNS /* defined in iomega8241.h */
+};
+
+/* Real Time Clock */
+extern spinlock_t rtc_lock;
+extern int ds1337_do_command(int id, int cmd, void *arg);
+#define DS1337_GET_DATE         0
+#define DS1337_SET_DATE         1
+
+unsigned char __res[sizeof(bd_t)];
+
+static void iomega8241_halt(void);
+
+/*
+ * Define all of the IRQ senses and polarities.  
+ */
+static u_char iomega8241_openpic_initsenses[] __initdata = {
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 0: AN983B */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 1: IDE VIA DS6410 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 2: USB */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 3: USB */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 4: USB */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 5: UART0 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 6: UART1 */
+};
+
+/*
+ * Define all of the PCI IRQ Mappings
+ */
+static inline int
+iomega8241_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
+{
+	static char pci_irq_table[][4] =
+	/*
+	 *	PCI IDSEL/INTPIN->INTLINE
+	 * 	   A   B   C   D
+	 */
+	{
+		{  1,  1,  0,  0 },	
+		{  2,  3,  4,  1 },	
+		{  0,  0,  4,  4 },	
+		{  3,  3,  4,  4 },	
+		{  3,  3,  4,  4 },	
+	};
+
+	const long min_idsel = 13, max_idsel = 17, irqs_per_slot = 4;
+	return PCI_IRQ_TABLE_LOOKUP;
+}
+
+static int                     
+iomega8241_exclude_device(u_char bus, u_char devfn)
+{
+	if ((bus == 0) && (PCI_SLOT(devfn) == IOMEGA8241_HOST_BRIDGE_IDSEL))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	else
+		return PCIBIOS_SUCCESSFUL;
+}
+
+static void __init
+iomega8241_find_bridges(void)
+{
+	struct pci_controller	*hose;
+
+	hose = pcibios_alloc_controller();
+
+	if (!hose)
+		return;
+
+	hose->first_busno = 0;
+	hose->last_busno = 0x1;
+
+	if (mpc10x_bridge_init(hose,
+			       MPC10X_MEM_MAP_B,
+			       MPC10X_MEM_MAP_B,
+			       MPC10X_MAPB_EUMB_BASE) == 0) {
+					   
+		ppc_md.pci_exclude_device = iomega8241_exclude_device;
+		hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
+		ppc_md.pcibios_fixup = NULL;
+		ppc_md.pcibios_fixup_bus = NULL;
+		ppc_md.pci_swizzle = common_swizzle;
+		ppc_md.pci_map_irq = iomega8241_map_irq;	
+	}
+	else {
+		if (ppc_md.progress)
+			ppc_md.progress("Bridge init failed", 0x100);
+		printk("Host bridge init failed\n");
+	}
+	return;
+}
+
+static void __init
+iomega8241_setup_arch(void)
+{
+	int i = 0;
+
+	loops_per_jiffy = 100000000 / HZ;
+
+#ifdef CONFIG_BLK_DEV_INITRD
+	if (initrd_start)
+		ROOT_DEV = Root_RAM0;
+	else
+#endif
+#ifdef	CONFIG_ROOT_NFS
+		ROOT_DEV = Root_NFS;
+#else
+		ROOT_DEV = Root_HDA1;
+#endif
+
+	/* Lookup PCI host bridges */
+	iomega8241_find_bridges();
+
+#ifdef CONFIG_DUMMY_CONSOLE
+	conswitchp = &dummy_con;
+#endif
+	
+	for (i = 0; i < 2; i++) {
+		rs_table[i].port = (ulong) ioremap (rs_table[i].port, PAGE_SIZE);
+		rs_table[i].iomem_base = (u8 *) rs_table[i].port;
+	}
+
+	writeb(readb(rs_table[1].iomem_base + 0x11) | 0x1, rs_table[1].iomem_base + 0x11);
+	
+	printk(KERN_INFO "Iomega StorCenter Network Hard Drive\n");
+	printk(KERN_INFO "Based on the Freescale Sandpoint Development System\n");
+
+	/* DINK32 12.3 and below do not correctly enable any caches.
+	 * We will do this now with good known values.  Future versions
+	 * of DINK32 are supposed to get this correct.
+	 */
+	if (cpu_has_feature(CPU_FTR_SPEC7450))
+		/* 745x is different.  We only want to pass along enable. */
+		_set_L2CR(L2CR_L2E);
+	else if (cpu_has_feature(CPU_FTR_L2CR))
+		/* All modules have 1MB of L2.  We also assume that an
+		 * L2 divisor of 3 will work.
+		 */
+		_set_L2CR(L2CR_L2E | L2CR_L2SIZ_1MB | L2CR_L2CLK_DIV3
+				| L2CR_L2RAM_PIPE | L2CR_L2OH_1_0 | L2CR_L2DF);
+#if 0
+	/* Untested right now. */
+	if (cpu_has_feature(CPU_FTR_L3CR)) {
+		/* Magic value. */
+		_set_L3CR(0x8f032000);
+	}
+#endif
+}
+
+#define	IOMEGA8241_87308_CFG_ADDR		0x15c
+#define	IOMEGA8241_87308_CFG_DATA		0x15d
+
+#define	IOMEGA8241_87308_CFG_INB(addr, byte) {				\
+	outb((addr), IOMEGA8241_87308_CFG_ADDR);				\
+	(byte) = inb(IOMEGA8241_87308_CFG_DATA);				\
+}
+
+#define	IOMEGA8241_87308_CFG_OUTB(addr, byte) {				\
+	outb((addr), IOMEGA8241_87308_CFG_ADDR);				\
+	outb((byte), IOMEGA8241_87308_CFG_DATA);				\
+}
+
+#define IOMEGA8241_87308_SELECT_DEV(dev_num) {				\
+	IOMEGA8241_87308_CFG_OUTB(0x07, (dev_num));			\
+}
+
+#define	IOMEGA8241_87308_DEV_ENABLE(dev_num) {				\
+	IOMEGA8241_87308_SELECT_DEV(dev_num);				\
+	IOMEGA8241_87308_CFG_OUTB(0x30, 0x01);				\
+}
+
+static int __init
+iomega8241_request_io(void)
+{
+	request_region(0x00,0x20,"dma1");
+	request_region(0x20,0x20,"pic1");
+	request_region(0x40,0x20,"timer");
+	request_region(0x80,0x10,"dma page reg");
+	request_region(0xa0,0x20,"pic2");
+	request_region(0xc0,0x20,"dma2");
+
+	return 0;
+}
+
+arch_initcall(iomega8241_request_io);
+
+/*
+ * Interrupt setup and service.  Interrrupts on the Sandpoint come
+ * from the four PCI slots plus the 8259 in the Winbond Super I/O (SIO).
+ * The 8259 is cascaded from EPIC IRQ0, IRQ1-4 map to PCI slots 1-4,
+ * IDE is on EPIC 7 and 8.
+ */
+static void __init
+iomega8241_init_IRQ(void)
+{
+	OpenPIC_InitSenses = iomega8241_openpic_initsenses;
+	OpenPIC_NumInitSenses = sizeof(iomega8241_openpic_initsenses);
+
+	/*
+	 * We need to tell openpic_set_sources where things actually are.
+	 * mpc10x_common will set up OpenPIC_Addr at ioremap(EUMB phys base +
+	 * EPIC offset (0x40000)); The EPIC IRQ register address map - 
+	 * Interrupt Source Configuration Registers gives these numbers as
+	 * offsets starting at 0x50200, we need to adjust accordingly
+	 */
+	openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200);
+	openpic_set_sources(5, 2, OpenPIC_Addr + 0x11120);
+	
+	openpic_init(0);
+}
+
+static int
+iomega8241_get_irq(struct pt_regs *regs)
+{
+	int irq;
+	
+	irq = openpic_irq();
+	if (irq == OPENPIC_VEC_SPURIOUS)
+		irq = -1;
+	
+	return irq;
+}
+
+static u32
+iomega8241_irq_canonicalize(u32 irq)
+{
+	return irq;
+}
+
+static void __init 
+iomega8241_init2(void)
+{
+	return;
+}
+
+static unsigned long __init
+iomega8241_find_end_of_memory(void)
+{
+	bd_t *bp = (bd_t *)__res;
+
+	if (bp->bi_memsize)
+		return bp->bi_memsize;
+
+	return 64*1024*1024;
+}
+
+static void __init
+iomega8241_map_io(void)
+{
+	/* changes suggested by Freescale: */
+	io_block_mapping(0xfc000000, 0xfc000000, 0x04000000, _PAGE_IO);
+}
+
+static void
+iomega8241_restart(char *cmd)
+{
+	local_irq_disable();
+
+	/* Set exception prefix high - to the firmware */
+	_nmask_and_or_msr(0, MSR_IP);
+
+	for(;;);	/* Spin until reset happens */
+}
+
+static void
+iomega8241_power_off(void)
+{
+	local_irq_disable();
+	for(;;);	/* No way to shut power off with software */
+	/* NOTREACHED */
+}
+
+static void
+iomega8241_halt(void)
+{
+	iomega8241_power_off();
+	/* NOTREACHED */
+}
+
+static int
+iomega8241_show_cpuinfo(struct seq_file *m)
+{
+	seq_printf(m, "vendor\t\t: Iomega Corporation\n");
+	seq_printf(m, "machine\t\t: Iomega StorCenter Network Hard Drive\n");
+
+	return 0;
+}
+
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
+/*
+ * IDE support.
+ */
+static int		iomega8241_ide_ports_known = 0;
+static unsigned long	iomega8241_ide_regbase[MAX_HWIFS];
+static unsigned long	iomega8241_ide_ctl_regbase[MAX_HWIFS];
+static unsigned long	iomega8241_idedma_regbase;
+
+static void
+iomega8241_ide_probe(void)
+{
+	struct pci_dev *pdev = pci_get_device(PCI_VENDOR_ID_VIA,
+			PCI_DEVICE_ID_VIA_6410, NULL);
+
+	if (pdev) {
+		iomega8241_ide_regbase[0]=pdev->resource[0].start;
+		iomega8241_ide_regbase[1]=pdev->resource[2].start;
+		iomega8241_ide_ctl_regbase[0]=pdev->resource[1].start;
+		iomega8241_ide_ctl_regbase[1]=pdev->resource[3].start;
+		iomega8241_idedma_regbase=pdev->resource[4].start;
+		
+		printk("Found: VIA VT6410 based IDE\n");
+	}
+
+	iomega8241_ide_ports_known = 1;
+}
+
+static int
+iomega8241_ide_default_irq(unsigned long base)
+{
+	if (iomega8241_ide_ports_known == 0)
+		iomega8241_ide_probe();
+
+	if (base == iomega8241_ide_regbase[0])
+		return IDE_INTRUPT;
+	else if (base == iomega8241_ide_regbase[1])
+		return IDE_INTRUPT;
+	else
+		return 0;
+}
+
+static unsigned long
+iomega8241_ide_default_io_base(int index)
+{
+	if (iomega8241_ide_ports_known == 0)
+		iomega8241_ide_probe();
+
+	return iomega8241_ide_regbase[index];
+}
+
+static void __init
+iomega8241_ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
+		unsigned long ctrl_port, int *irq)
+{
+	unsigned long reg = data_port;
+	uint	alt_status_base;
+	int	i;
+
+	for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+		hw->io_ports[i] = reg++;
+	}
+
+	if (data_port == iomega8241_ide_regbase[0]) {
+		alt_status_base = iomega8241_ide_ctl_regbase[0] + 2;
+		hw->irq = IDE_INTRUPT;
+	} else if (data_port == iomega8241_ide_regbase[1]) {
+		alt_status_base = iomega8241_ide_ctl_regbase[1] + 2;
+		hw->irq = IDE_INTRUPT;
+	} else {
+		alt_status_base = 0;
+		hw->irq = 0;
+	}
+
+	if (ctrl_port) {
+		hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+	} else {
+		hw->io_ports[IDE_CONTROL_OFFSET] = alt_status_base;
+	}
+
+	if (irq != NULL) {
+		*irq = hw->irq;
+	}
+}
+#endif
+
+/*
+ * Set BAT 3 to map 0xf8000000 to end of physical memory space 1-to-1.
+ */
+static __inline__ void
+iomega8241_set_bat(void)
+{
+	unsigned long bat3u, bat3l;
+
+	__asm__ __volatile__(
+			" lis %0,0xf800\n	\
+			ori %1,%0,0x002a\n	\
+			ori %0,%0,0x0ffe\n	\
+			mtspr 0x21e,%0\n	\
+			mtspr 0x21f,%1\n	\
+			isync\n			\
+			sync "
+			: "=r" (bat3u), "=r" (bat3l));
+}
+
+TODC_ALLOC();
+
+/* Real Time Clock support.
+ * StorCenter has a DS1337 accessed by I2C.
+ */
+static ulong iomega8241_get_rtc_time(void)
+{
+	struct rtc_time tm;
+	int result;
+
+	spin_lock(&rtc_lock);
+	result = ds1337_do_command(0, DS1337_GET_DATE, &tm);
+	spin_unlock(&rtc_lock);
+
+	if (result == 0)
+		result = mktime(tm.tm_year, tm.tm_mon, tm.tm_mday,
+	tm.tm_hour, tm.tm_min, tm.tm_sec);
+
+	return result;
+}
+
+static int iomega8241_set_rtc_time(unsigned long nowtime)
+{
+	struct rtc_time tm;
+	int result;
+
+	spin_lock(&rtc_lock);
+	to_tm(nowtime, &tm);
+	result = ds1337_do_command(0, DS1337_SET_DATE, &tm);
+	spin_unlock(&rtc_lock);
+
+	return result;
+}
+
+
+void __init
+platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+		unsigned long r6, unsigned long r7)
+{
+	parse_bootinfo(find_bootinfo());
+
+	/* ASSUMPTION:  If both r3 (bd_t pointer) and r6 (cmdline pointer)
+	 * are non-zero, then we should use the board info from the bd_t
+	 * structure and the cmdline pointed to by r6 instead of the
+	 * information from birecs, if any.  Otherwise, use the information
+	 * from birecs as discovered by the preceeding call to
+	 * parse_bootinfo().  This rule should work with both PPCBoot, which
+	 * uses a bd_t board info structure, and the kernel boot wrapper,
+	 * which uses birecs.
+	 */
+	if (r3 && r6) {
+		/* copy board info structure */
+		memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
+		/* copy command line */
+		*(char *)(r7+KERNELBASE) = 0;
+		strcpy(cmd_line, (char *)(r6+KERNELBASE));
+	}
+
+#ifdef CONFIG_BLK_DEV_INITRD
+	/* take care of initrd if we have one */
+	if (r4) {
+		initrd_start = r4 + KERNELBASE;
+		initrd_end = r5 + KERNELBASE;
+	}
+#endif /* CONFIG_BLK_DEV_INITRD */
+
+	/* Map in board regs, etc. */
+	iomega8241_set_bat();
+
+	isa_io_base = MPC10X_MAPB_ISA_IO_BASE;
+	isa_mem_base = MPC10X_MAPB_ISA_MEM_BASE;
+	pci_dram_offset = MPC10X_MAPB_DRAM_OFFSET;
+	ISA_DMA_THRESHOLD = 0x00ffffff;
+	DMA_MODE_READ = 0x44;
+	DMA_MODE_WRITE = 0x48;
+
+	ppc_md.setup_arch = iomega8241_setup_arch;
+	ppc_md.show_cpuinfo = iomega8241_show_cpuinfo;
+	ppc_md.irq_canonicalize = iomega8241_irq_canonicalize;
+	ppc_md.init_IRQ = iomega8241_init_IRQ;
+	ppc_md.get_irq = iomega8241_get_irq;
+	ppc_md.init = iomega8241_init2;
+
+	ppc_md.restart = iomega8241_restart;
+	ppc_md.power_off = iomega8241_power_off;
+	ppc_md.halt = iomega8241_halt;
+
+	ppc_md.find_end_of_memory = iomega8241_find_end_of_memory;
+	ppc_md.setup_io_mappings = iomega8241_map_io;
+
+	/* What USI had in their 2.4.21 kernel: */
+  	ppc_md.set_rtc_time = iomega8241_set_rtc_time;
+  	ppc_md.get_rtc_time = iomega8241_get_rtc_time;
+	ppc_md.calibrate_decr = todc_calibrate_decr;
+
+	ppc_md.find_end_of_memory = iomega8241_find_end_of_memory;
+	ppc_md.setup_io_mappings = iomega8241_map_io;
+
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
+	ppc_ide_md.default_irq = iomega8241_ide_default_irq;
+	ppc_ide_md.default_io_base = iomega8241_ide_default_io_base;
+	ppc_ide_md.ide_init_hwif = iomega8241_ide_init_hwif_ports;
+#endif
+}
diff -urN linux-original/arch/ppc/platforms/iomega8241.h linux/arch/ppc/platforms/iomega8241.h
--- linux-original/arch/ppc/platforms/iomega8241.h	1969-12-31 19:00:00.000000000 -0500
+++ linux/arch/ppc/platforms/iomega8241.h	2005-08-08 13:11:35.000000000 -0400
@@ -0,0 +1,76 @@
+/*
+ * arch/ppc/platforms/iomega8241.h
+ *
+ * The Iomega StorCenter Network Hard Drive platform is based on the
+ * original sandpoint test platform.  That GNU copyright information
+ * is reproduced below:
+ *
+ * Board setup routines for the Motorola SPS Sandpoint Test Platform.
+ *
+ * Author: Mark A. Greer
+ *	 mgreer@mvista.com
+ *
+ * 2000-2003 (c) MontaVista Software, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#ifndef __PPC_PLATFORMS_IOMEGA8241_H
+#define __PPC_PLATFORMS_IOMEGA8241_H
+
+#include <asm/ppcboot.h>
+#include <linux/config.h>
+
+/*
+ * G2 Configuration:
+ * 
+ * DEVICE				IDSEL				INTERRUPT NUMBER
+ * AN983B				AD12				IRQ0
+ * IDE Via DS6410		AD13				IRQ1
+ * NEC USB uPD720101	AD14				IRQ2,3,4
+ */
+
+#define IDE_INTRUPT		1
+
+/*
+ * The sandpoint boards have processor modules that either have an 8240 or
+ * an MPC107 host bridge on them.  These bridges have an IDSEL line that allows
+ * them to respond to PCI transactions as if they were a normal PCI devices.
+ * However, the processor on the processor side of the bridge can not reach
+ * out onto the PCI bus and then select the bridge or bad things will happen
+ * (documented in the 8240 and 107 manuals).
+ * Because of this, we always skip the bridge PCI device when accessing the
+ * PCI bus.  The PCI slot that the bridge occupies is defined by the macro
+ * below.
+ */
+#define IOMEGA8241_HOST_BRIDGE_IDSEL     12
+
+void board_find_bridges(void);
+void iomega8241_fix_uart(void);
+/*
+ * Serial defines.
+ */
+#define IOMEGA8241_SERIAL_0		0xFDF04500
+#define IOMEGA8241_SERIAL_1		0xFDF04600
+
+#define RS_TABLE_SIZE  4
+
+/* Rate for the 1.8432 Mhz clock for the onboard serial chip */
+#define BASE_BAUD			( 100000000 / 16 ) /* 100Mhz speed, divided by 16 
+												to make the output freqency*/
+#define UART_CLK			1843200
+
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
+
+#define STD_SERIAL_PORT_DFNS \
+        { 0, BASE_BAUD, IOMEGA8241_SERIAL_0, 5, STD_COM_FLAGS, /* ttyS0 */ \
+		iomem_base: (u8 *)IOMEGA8241_SERIAL_0,			  \
+		io_type: SERIAL_IO_MEM },		\
+		{ 0, BASE_BAUD, IOMEGA8241_SERIAL_1, 6, STD_COM_FLAGS, /* ttyS1 */ \
+		iomem_base: (u8 *)IOMEGA8241_SERIAL_1,			  \
+		io_type: SERIAL_IO_MEM },	
+
+#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DFNS
+		
+#endif /* __PPC_PLATFORMS_IOMEGA8241_H */
diff -urN linux-original/arch/ppc/syslib/Makefile linux/arch/ppc/syslib/Makefile
--- linux-original/arch/ppc/syslib/Makefile	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/syslib/Makefile	2005-07-08 08:55:27.000000000 -0400
@@ -77,6 +77,7 @@
 obj-$(CONFIG_PRPMC800)		+= open_pic.o indirect_pci.o pci_auto.o
 obj-$(CONFIG_RADSTONE_PPC7D)	+= i8259.o pci_auto.o
 obj-$(CONFIG_SANDPOINT)		+= i8259.o pci_auto.o todc_time.o
+obj-$(CONFIG_IOMEGA8241)	+= i8259.o pci_auto.o todc_time.o
 obj-$(CONFIG_SBC82xx)		+= todc_time.o
 obj-$(CONFIG_SPRUCE)		+= cpc700_pic.o indirect_pci.o pci_auto.o \
 				   todc_time.o
diff -urN linux-original/arch/ppc/syslib/mpc10x_common.c linux/arch/ppc/syslib/mpc10x_common.c
--- linux-original/arch/ppc/syslib/mpc10x_common.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/syslib/mpc10x_common.c	2005-07-08 08:55:27.000000000 -0400
@@ -330,7 +330,7 @@
 	 * 8245 (Rev 2., dated 10/2003) says PICR2[0] is reserverd.
 	 */
 	if (host_bridge == MPC10X_BRIDGE_8245) {
-		ulong	picr2;
+		uint	picr2 = 0;
 
 		early_read_config_dword(hose, 0, PCI_DEVFN(0,0),
 			MPC10X_CFG_PICR2_REG, &picr2);
diff -urN linux-original/arch/ppc/syslib/open_pic.c linux/arch/ppc/syslib/open_pic.c
--- linux-original/arch/ppc/syslib/open_pic.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/syslib/open_pic.c	2005-07-08 08:55:27.000000000 -0400
@@ -319,8 +319,7 @@
 	}
 	OpenPIC = (volatile struct OpenPIC __iomem *)OpenPIC_Addr;
 
-#ifdef CONFIG_EPIC_SERIAL_MODE
-	/* Have to start from ground zero.
+#if defined(CONFIG_EPIC_SERIAL_MODE)
 	*/
 	openpic_reset();
 #endif
@@ -1073,4 +1072,3 @@
 }
 
 subsys_initcall(init_openpic_sysfs);
-
diff -urN linux-original/arch/ppc/syslib/todc_time.c linux/arch/ppc/syslib/todc_time.c
--- linux-original/arch/ppc/syslib/todc_time.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/arch/ppc/syslib/todc_time.c	2005-08-08 12:58:47.000000000 -0400
@@ -412,6 +412,7 @@
 	return 0;
 }
 
+#ifndef CONFIG_IOMEGA8241 /* Not used by the Iomega8241 platform */
 /*
  * Manipulates read bit to reliably read seconds at a high rate.
  */
@@ -450,6 +451,8 @@
 	return val;
 }
 
+#endif /* CONFIG_IOMEGA8241 */
+
 /*
  * This was taken from prep_setup.c
  * Use the NVRAM RTC to time a second to calibrate the decrementer.
@@ -457,10 +460,13 @@
 void __init
 todc_calibrate_decr(void)
 {
+#ifdef CONFIG_IOMEGA8241
+	ulong freq = 25000000;
+#else
 	ulong	freq;
 	ulong	tbl, tbu;
-        long	i, loop_count;
-        u_char	sec;
+	long	i, loop_count;
+	u_char	sec;
 
 	todc_time_init();
 
@@ -502,7 +508,8 @@
 
 		freq -= tbl;
 	} while ((get_tbu() != tbu) && (++loop_count < 2));
-
+#endif /* CONFIG_IOMEGA8241 */
+	
 	printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
 	       freq/1000000, freq%1000000);
 
diff -urN linux-original/drivers/char/rtc.c linux/drivers/char/rtc.c
--- linux-original/drivers/char/rtc.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/char/rtc.c	2005-07-08 08:55:27.000000000 -0400
@@ -498,9 +498,16 @@
 	}
 	case RTC_RD_TIME:	/* Read the time/date from RTC	*/
 	{
+#ifdef CONFIG_IOMEGA8241
+		unsigned long usi_time;
+		usi_time = ds1337_get_time();
+		to_tm(usi_time,wtime);
+		break;
+#else		
 		memset(&wtime, 0, sizeof(struct rtc_time));
 		rtc_get_rtc_time(&wtime);
 		break;
+#endif /* CONFIG_IOMEGA8241 */
 	}
 	case RTC_SET_TIME:	/* Set the RTC */
 	{
@@ -542,7 +549,7 @@
 
 		if ((yrs -= epoch) > 255)    /* They are unsigned */
 			return -EINVAL;
-
+#ifndef CONFIG_IOMEGA8241
 		spin_lock_irq(&rtc_lock);
 #ifdef CONFIG_MACH_DECSTATION
 		real_yrs = yrs;
@@ -598,6 +605,11 @@
 
 		spin_unlock_irq(&rtc_lock);
 		return 0;
+#else /* CONFIG_IOMEGA8241 */
+                /* next is the forth API provided by ds1337.c 	USI-SS */
+                ds1337_usi_set_time(yrs,mon,day,hrs,min,sec);
+                break;
+#endif /* CONFIG_IOMEGA8241 */
 	}
 #ifdef RTC_IRQ
 	case RTC_IRQP_READ:	/* Read the periodic IRQ rate.	*/
diff -urN linux-original/drivers/i2c/busses/i2c-mpc.c linux/drivers/i2c/busses/i2c-mpc.c
--- linux-original/drivers/i2c/busses/i2c-mpc.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/i2c/busses/i2c-mpc.c	2005-08-26 15:04:29.000000000 -0400
@@ -68,6 +68,7 @@
 	writeb(x, i2c->base + MPC_I2C_CR);
 }
 
+#ifndef CONFIG_IOMEGA8241
 static irqreturn_t mpc_i2c_isr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct mpc_i2c *i2c = dev_id;
@@ -79,6 +80,7 @@
 	}
 	return IRQ_HANDLED;
 }
+#endif /* CONFIG_IOMEGA8241 */
 
 static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
 {
@@ -291,7 +293,11 @@
 	.algo = &mpc_algo,
 	.class = I2C_CLASS_HWMON,
 	.timeout = 1,
+#ifdef CONFIG_IOMEGA8241
+	.retries = 400
+#else
 	.retries = 1
+#endif /* CONFIG_IOMEGA8241 */
 };
 
 #ifdef CONFIG_FSL_OCP
@@ -322,6 +328,7 @@
 		goto fail_map;
 	}
 
+#ifndef CONFIG_IOMEGA8241
 	if (i2c->irq != OCP_IRQ_NA)
 	{
 		if ((result = request_irq(ocp->def->irq, mpc_i2c_isr,
@@ -331,6 +338,7 @@
 			goto fail_irq;
 		}
 	} else
+#endif /* CONFIG_IOMEGA8241 */
 		i2c->irq = 0;
 
 	i2c->adap = mpc_ops;
@@ -348,8 +356,10 @@
       fail_add:
 	if (ocp->def->irq != OCP_IRQ_NA)
 		free_irq(ocp->def->irq, 0);
+#ifndef CONFIG_IOMEGA8241
       fail_irq:
 	iounmap(i2c->base);
+#endif /* CONFIG_IOMEGA8241 */
       fail_map:
 	release_mem_region(ocp->def->paddr, MPC_I2C_REGION);
 	kfree(i2c);
diff -urN linux-original/drivers/i2c/chips/ds1337.c linux/drivers/i2c/chips/ds1337.c
--- linux-original/drivers/i2c/chips/ds1337.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/i2c/chips/ds1337.c	2005-09-13 15:16:43.000000000 -0400
@@ -20,10 +20,11 @@
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 #include <linux/string.h>
-#include <linux/rtc.h>		/* get the user-level API */
+#include <linux/rtc.h>	
 #include <linux/bcd.h>
 #include <linux/list.h>
 
+
 /* Device registers */
 #define DS1337_REG_HOUR		2
 #define DS1337_REG_DAY		3
@@ -75,7 +76,9 @@
 /*
  * Internal variables
  */
+#ifndef CONFIG_IOMEGA8241
 static int ds1337_id;
+#endif /* CONFIG_IOMEGA8241 */
 static LIST_HEAD(ds1337_clients);
 
 static inline int ds1337_read(struct i2c_client *client, u8 reg, u8 *value)
@@ -95,7 +98,9 @@
  */
 static int ds1337_get_datetime(struct i2c_client *client, struct rtc_time *dt)
 {
+#ifndef CONFIG_IOMEGA8241
 	struct ds1337_data *data = i2c_get_clientdata(client);
+#endif /* CONFIG_IOMEGA8241 */
 	int result;
 	u8 buf[7];
 	u8 val;
@@ -119,8 +124,12 @@
 	msg[1].len = sizeof(buf);
 	msg[1].buf = &buf[0];
 
+#ifdef CONFIG_IOMEGA8241
+	result = i2c_transfer(client->adapter, msg, 2);
+#else
 	result = client->adapter->algo->master_xfer(client->adapter,
 						    &msg[0], 2);
+#endif /* CONFIG_IOMEGA8241 */
 
 	dev_dbg(&client->adapter->dev,
 		"%s: [%d] %02x %02x %02x %02x %02x %02x %02x\n",
@@ -145,6 +154,7 @@
 			__FUNCTION__, dt->tm_sec, dt->tm_min,
 			dt->tm_hour, dt->tm_mday,
 			dt->tm_mon, dt->tm_year, dt->tm_wday);
+#ifndef CONFIG_IOMEGA8241
 	} else {
 		dev_err(&client->adapter->dev, "ds1337[%d]: error reading "
 			"data! %d\n", data->id, result);
@@ -152,11 +162,20 @@
 	}
 
 	return result;
+#else
+		return 0;
+	}
+	dev_err(&client->dev, "error reading data! %d\n", result);
+	return -EIO;
+#endif /* CONFIG_IOMEGA8241 */
+
 }
 
 static int ds1337_set_datetime(struct i2c_client *client, struct rtc_time *dt)
 {
+#ifndef CONFIG_IOMEGA8241
 	struct ds1337_data *data = i2c_get_clientdata(client);
+#endif /* CONFIG_IOMEGA8241 */
 	int result;
 	u8 buf[8];
 	u8 val;
@@ -177,7 +196,7 @@
 	buf[0] = 0;		/* reg offset */
 	buf[1] = BIN_TO_BCD(dt->tm_sec);
 	buf[2] = BIN_TO_BCD(dt->tm_min);
-	buf[3] = BIN_TO_BCD(dt->tm_hour) | (1 << 6);
+	buf[3] = BIN_TO_BCD(dt->tm_hour) /*& (0 << 6)*/;
 	buf[4] = BIN_TO_BCD(dt->tm_wday) + 1;
 	buf[5] = BIN_TO_BCD(dt->tm_mday);
 	buf[6] = BIN_TO_BCD(dt->tm_mon);
@@ -194,6 +213,14 @@
 	msg[0].len = sizeof(buf);
 	msg[0].buf = &buf[0];
 
+#ifdef CONFIG_IOMEGA8241
+	result = i2c_transfer(client->adapter, msg, 1);
+
+	if (result == 1)
+		return 0;
+	dev_err(&client->dev, "error writing data! %d\n", result);
+	return -EIO;
+#else
 	result = client->adapter->algo->master_xfer(client->adapter,
 						    &msg[0], 1);
 	if (result < 0) {
@@ -205,6 +232,7 @@
 	}
 
 	return result;
+#endif /* CONFIG_IOMEGA8241 */
 }
 
 static int ds1337_command(struct i2c_client *client, unsigned int cmd,
@@ -228,6 +256,22 @@
  * Public API for access to specific device. Useful for low-level
  * RTC access from kernel code.
  */
+#ifdef CONFIG_IOMEGA8241
+int ds1337_do_command(int bus, int cmd, void *arg)
+{
+	struct list_head *walk;
+	struct list_head *tmp;
+	struct ds1337_data *data;
+
+	list_for_each_safe(walk, tmp, &ds1337_clients) {
+		data = list_entry(walk, struct ds1337_data, list);
+		if (data->client.adapter->nr == bus)
+			return ds1337_command(&data->client, cmd, arg);
+	}
+
+	return -ENODEV;
+}
+#else
 int ds1337_do_command(int id, int cmd, void *arg)
 {
 	struct list_head *walk;
@@ -242,6 +286,7 @@
 
 	return -ENODEV;
 }
+#endif /* CONFIG_IOMEGA8241 */
 
 static int ds1337_attach_adapter(struct i2c_adapter *adapter)
 {
@@ -346,7 +391,9 @@
 	ds1337_init_client(new_client);
 
 	/* Add client to local list */
+#ifndef CONFIG_IOMEGA8241
 	data->id = ds1337_id++;
+#endif /* CONFIG_IOMEGA8241 */
 	list_add(&data->list, &ds1337_clients);
 
 	return 0;
@@ -363,9 +410,9 @@
 
 	/* Ensure that device is set in 24-hour mode */
 	val = i2c_smbus_read_byte_data(client, DS1337_REG_HOUR);
-	if ((val >= 0) && (val & (1 << 6)) == 0)
+	if ((val >= 0) && (val & (0 << 6)))
 		i2c_smbus_write_byte_data(client, DS1337_REG_HOUR,
-					  val | (1 << 6));
+					  val & 0x3f);
 }
 
 static int ds1337_detach_client(struct i2c_client *client)
@@ -398,5 +445,9 @@
 MODULE_DESCRIPTION("DS1337 RTC driver");
 MODULE_LICENSE("GPL");
 
+#ifdef CONFIG_IOMEGA8241
+EXPORT_SYMBOL_GPL(ds1337_do_command);
+#endif /* CONFIG_IOMEGA8241 */
+
 module_init(ds1337_init);
 module_exit(ds1337_exit);
diff -urN linux-original/drivers/ide/pci/via82cxxx.c linux/drivers/ide/pci/via82cxxx.c
--- linux-original/drivers/ide/pci/via82cxxx.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/ide/pci/via82cxxx.c	2005-08-08 13:06:52.000000000 -0400
@@ -79,6 +79,7 @@
 	u8 rev_max;
 	u16 flags;
 } via_isa_bridges[] = {
+	{ "vt6410",	PCI_DEVICE_ID_VIA_6410,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
 	{ "vt8237",	PCI_DEVICE_ID_VIA_8237,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
 	{ "vt8235",	PCI_DEVICE_ID_VIA_8235,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
 	{ "vt8233a",	PCI_DEVICE_ID_VIA_8233A,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -145,6 +146,7 @@
 	int len;
 	u16 c, w;
 	u8 t, x;
+	u8 ar0, ar1, ar2, ar3;
 	char *p = buffer;
 
 	via_print("----------VIA BusMastering IDE Configuration"
@@ -176,6 +178,108 @@
 	via_print("Max DRDY Pulse Width:               %s%s",
 		via_control3[(t & 0x03)], (t & 0x03) ? " PCI clocks" : "");
 
+#ifdef CONFIG_IOMEGA8241
+	if(via_config->id == PCI_DEVICE_ID_VIA_6410) {
+		/*
+		 * Additional debug information for the VIA VT6410 
+		 * IDE Host Controller
+		 */
+		 
+		pci_read_config_byte(dev, 0x9, &ar0);
+		via_print("Programming Interface:              %#x",ar0);
+	
+		pci_read_config_byte(dev, 0xa, &ar0);
+		via_print("Sub Class Code:                     %#x",ar0);
+
+		pci_read_config_byte(dev, 0xb, &ar0);
+		via_print("Base Class Code:                    %#x",ar0);
+
+		pci_read_config_byte(dev, 0xd, &ar0);
+		via_print("Latency Timer:                      %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x34, &ar0);
+		via_print("Capability Pointer:                 %#x",ar0);
+
+		pci_read_config_byte(dev, 0x3c, &ar0);
+		via_print("Interrupt Line:                     %#x",ar0);
+
+		pci_read_config_byte(dev, 0x3d, &ar0);
+		via_print("Interrupt Pin:                      %#x",ar0);
+
+		pci_read_config_byte(dev, 0x3e, &ar0);
+		via_print("Minimum Grant:                      %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x3f, &ar0);
+		via_print("Maximum Latency:                    %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x40, &ar0);
+		via_print("IDE Chip Enable:                    %#x",ar0);
+
+		pci_read_config_byte(dev, VIA_IDE_CONFIG, &ar0);
+		via_print("IDE Configuration I:                %#x",ar0);
+	
+		pci_read_config_byte(dev, VIA_IDE_CONFIG+1, &ar0);
+		via_print("IDE Configuration II:               %#x",ar0);
+	
+		pci_read_config_byte(dev, VIA_FIFO_CONFIG, &ar0);
+		via_print("IDE FIFO Configuration:             %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x44, &ar0);
+		via_print("IDE Miscellaneous Control 1:        %#x",ar0);
+
+		pci_read_config_byte(dev, 0x45, &ar0);
+		via_print("IDE Miscellaneous Control 2:        %#x",ar0);
+
+		pci_read_config_byte(dev, 0x46, &ar0);
+		via_print("IDE Miscellaneous Control 3:        %#x",ar0);
+
+		pci_read_config_byte(dev, VIA_DRIVE_TIMING+3, &ar0);
+		pci_read_config_byte(dev, VIA_DRIVE_TIMING+2, &ar1);
+		pci_read_config_byte(dev, VIA_DRIVE_TIMING+1, &ar2);
+		pci_read_config_byte(dev, VIA_DRIVE_TIMING, &ar3);
+		via_print("IDE Drive Timing Control:           %#x%x%x%x",ar0, ar1, ar2, ar3);
+	
+		pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &ar0);
+		via_print("IDE Address Setup TIme:             %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x4e, &ar0);
+		via_print("Sec Non-1FO Port Access Timing:     %#x",ar0);
+
+		pci_read_config_byte(dev, 0x4f, &ar0);
+		via_print("Pri Non-1FO Port Access Timing:     %#x",ar0);
+	
+		pci_read_config_byte(dev, VIA_UDMA_TIMING+3, &ar0);
+		pci_read_config_byte(dev, VIA_UDMA_TIMING+2, &ar1);
+		pci_read_config_byte(dev, VIA_UDMA_TIMING+1, &ar2);
+		pci_read_config_byte(dev, VIA_UDMA_TIMING, &ar3);
+		via_print("UltraDMA Extended Timing Control:   %#x%x%x%x",ar0, ar1, ar2, ar3);
+	
+		pci_read_config_byte(dev, 0x54, &ar0);
+		via_print("Revision Register:                  %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x58, &ar0);
+		via_print("PLL Ctrl/Test Mode Enabled:         %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x59, &ar0);
+		via_print("Slew Rate Control:                  %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x5a, &ar0);
+		via_print("DRVRST Clock Gate/Bus TS Ctrl:      %#x",ar0);
+
+		pci_read_config_byte(dev, 0x70, &ar0);
+		via_print("IDE Primary Status:                 %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x71, &ar0);
+		via_print("IDE Pri Interrupt Control:          %#x",ar0);
+
+		pci_read_config_byte(dev, 0x78, &ar0);
+		via_print("IDE Secondary Status:               %#x",ar0);
+	
+		pci_read_config_byte(dev, 0x79, &ar0);
+		via_print("IDE Sec Interrupt Control:          %#x",ar0);
+	}
+#endif /* CONFIG_IOMEGA8241 */
+
 	via_print("-----------------------Primary IDE"
 		"-------Secondary IDE------");
 	via_print("Read DMA FIFO flush:   %10s%20s",
@@ -479,10 +583,15 @@
 
 		case VIA_UDMA_133:
 			pci_read_config_dword(dev, VIA_UDMA_TIMING, &u);
+#ifdef CONFIG_IOMEGA8241		
+			/* The VIA 6410 iis not properly detecting cable types */
+			for (i = 24; i >= 0; i -= 8) {
+#else
 			for (i = 24; i >= 0; i -= 8)
 				if (((u >> i) & 0x10) ||
 				    (((u >> i) & 0x20) &&
-				     (((u >> i) & 7) < 6))) {
+				     (((u >> i) & 7) < 4))) {
+#endif /* CONFIG_IOMEGA8241 */
 					/* BIOS 80-wire bit or
 					 * UDMA w/ < 60ns/cycle
 					 */
@@ -502,6 +611,10 @@
 	/*
 	 * Check whether interfaces are enabled.
 	 */
+	if(via_config->id == PCI_DEVICE_ID_VIA_6410) {
+		pci_read_config_byte(dev, VIA_IDE_ENABLE, &v);
+		pci_write_config_byte(dev, VIA_IDE_ENABLE, v | 0x3);
+	}
 
 	pci_read_config_byte(dev, VIA_IDE_ENABLE, &v);
 
@@ -615,25 +728,35 @@
 	hwif->drives[0].autodma = hwif->autodma;
 	hwif->drives[1].autodma = hwif->autodma;
 }
-
-static ide_pci_device_t via82cxxx_chipset __devinitdata = {
-	.name		= "VP_IDE",
-	.init_chipset	= init_chipset_via82cxxx,
-	.init_hwif	= init_hwif_via82cxxx,
-	.channels	= 2,
-	.autodma	= NOAUTODMA,
-	.enablebits	= {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
-	.bootable	= ON_BOARD,
+static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
+	{/* 0 */
+		.name           = "VP_IDE",
+		.init_chipset   = init_chipset_via82cxxx,
+		.init_hwif      = init_hwif_via82cxxx,
+		.channels       = 2,
+		.autodma        = NOAUTODMA,
+		.enablebits     = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
+		.bootable       = ON_BOARD,
+	},{ /* 1 */
+		.name           = "VP_IDE",
+		.init_chipset   = init_chipset_via82cxxx,
+		.init_hwif      = init_hwif_via82cxxx,
+		.channels       = 2,
+		.autodma        = AUTODMA, // AUTODMA
+		.enablebits     = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
+		.bootable       = NEVER_BOARD,
+	}
 };
 
 static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	return ide_setup_pci_device(dev, &via82cxxx_chipset);
+	return ide_setup_pci_device(dev, &via82cxxx_chipsets[id->driver_data]);
 }
 
 static struct pci_device_id via_pci_tbl[] = {
 	{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, via_pci_tbl);
diff -urN linux-original/drivers/mtd/maps/Kconfig linux/drivers/mtd/maps/Kconfig
--- linux-original/drivers/mtd/maps/Kconfig	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/mtd/maps/Kconfig	2005-07-08 08:55:27.000000000 -0400
@@ -659,5 +659,10 @@
 	help
 	  This enables access to the flash chip on the Sharp SL Series of PDAs.
 
-endmenu
+config MTD_IOMEGA8241
+	tristate "Map driver for the Iomega 8241 StorCenter board"
+	depends on IOMEGA8241
+	help
+	  Map driver for the Iomega StorCenter Network Hard Drive.
 
+endmenu
diff -urN linux-original/drivers/mtd/maps/Makefile linux/drivers/mtd/maps/Makefile
--- linux-original/drivers/mtd/maps/Makefile	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/mtd/maps/Makefile	2005-07-08 08:55:27.000000000 -0400
@@ -71,3 +71,4 @@
 obj-$(CONFIG_MTD_WRSBC8260)	+= wr_sbc82xx_flash.o
 obj-$(CONFIG_MTD_DMV182)	+= dmv182.o
 obj-$(CONFIG_MTD_SHARP_SL)	+= sharpsl-flash.o
+obj-$(CONFIG_MTD_IOMEGA8241)   += iomega8241_mtd.o
diff -urN linux-original/drivers/mtd/maps/iomega8241_mtd.c linux/drivers/mtd/maps/iomega8241_mtd.c
--- linux-original/drivers/mtd/maps/iomega8241_mtd.c	1969-12-31 19:00:00.000000000 -0500
+++ linux/drivers/mtd/maps/iomega8241_mtd.c	2005-08-08 13:08:50.000000000 -0400
@@ -0,0 +1,102 @@
+/*
+ * drivers/mtd/maps/iomega8241_mtd.c
+ *
+ * Iomega Corporation
+ * 
+ * Flash mapping for the Iomega StorCenter Network Hard Drive
+ *
+ * This module is based on the mpc1211.c file created by 
+ * Saito.K & Jeanne <ksaito@interface.co.jp>
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <asm/io.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/config.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/immap_cpm2.h>
+
+static struct mtd_info *iomegamtd;
+static struct mtd_partition *parsed_parts;
+
+struct map_info iomega8241_flash_map = {
+	.name 		= "Flash",
+	.phys		= 0xFF800000,
+	.size		= 0x800000,
+	.bankwidth	= 1,
+};
+
+static struct mtd_partition iomega8241_partitions[] = {
+	{
+		.name =		"kernel",
+		/* 1507328 bytes: kernel space */
+		.size =		0x00170000, 
+		.offset =	0,
+	}, {
+		.name =		"filesystem",
+		/* 5832704 bytes: root partition */
+		.size =		0x00590000, 
+		/* start is FF970000 */
+		.offset =	MTDPART_OFS_APPEND, 
+	}, {
+		.name =		"bootloader",
+		/* 262144 bytes for u-boot */
+		.size =		0x00040000, 
+		/* start is FFF00000 */
+		.offset =	MTDPART_OFS_APPEND, 
+	}, {
+		.name =		"sysconfig",
+		/* 786432 bytes: sysconf partition */
+		.size =		0x000C0000, 
+		/* start is FFF40000 */
+		.offset =	MTDPART_OFS_APPEND, 
+	} 
+};
+
+static int __init 
+init_iomega8241_flash(void)			
+{
+	int nr_parts;
+		
+	iomega8241_flash_map.virt = ioremap(iomega8241_flash_map.phys, iomega8241_flash_map.size);
+
+	simple_map_init(&iomega8241_flash_map);
+
+	printk("Iomega8241: Probing for flash...\n");
+	iomegamtd = do_map_probe("cfi_probe", &iomega8241_flash_map);
+	if (!iomegamtd) {
+		printk(KERN_NOTICE "Flash chips not detected at either possible location.\n");
+		return -ENXIO;
+	}
+	printk("Iomega8241: Flash found at location 0x%x\n", iomega8241_flash_map.phys);
+	iomegamtd->owner = THIS_MODULE;
+
+	parsed_parts = iomega8241_partitions;
+	nr_parts = ARRAY_SIZE(iomega8241_partitions);
+
+	add_mtd_partitions(iomegamtd, parsed_parts, nr_parts);
+	return 0;
+}
+
+static void __exit 
+cleanup_iomega8241_flash(void)
+{
+	if (parsed_parts)
+		del_mtd_partitions(iomegamtd);
+	else
+		del_mtd_device(iomegamtd);
+	map_destroy(iomegamtd);
+}
+
+module_init(init_iomega8241_flash);
+module_exit(cleanup_iomega8241_flash);
+
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Anthony Russello <russello@iomega.com>");
+MODULE_DESCRIPTION("Flash mapping for the Iomega StorCenter Network Hard Drive");
diff -urN linux-original/drivers/net/r8169.c linux/drivers/net/r8169.c
--- linux-original/drivers/net/r8169.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/net/r8169.c	2005-07-08 08:55:27.000000000 -0400
@@ -1,261 +1,268 @@
 /*
 =========================================================================
- r8169.c: A RealTek RTL-8169 Gigabit Ethernet driver for Linux kernel 2.4.x.
+ r8169.c: A RealTek RTL8169s/8110s Gigabit Ethernet driver for Linux kernel 2.4.x.
  --------------------------------------------------------------------
 
  History:
  Feb  4 2002	- created initially by ShuChen <shuchen@realtek.com.tw>.
  May 20 2002	- Add link status force-mode and TBI mode support.
-        2004	- Massive updates. See kernel SCM system for details.
 =========================================================================
-  1. [DEPRECATED: use ethtool instead] The media can be forced in 5 modes.
-	 Command: 'insmod r8169 media = SET_MEDIA'
-	 Ex:	  'insmod r8169 media = 0x04' will force PHY to operate in 100Mpbs Half-duplex.
-	
-	 SET_MEDIA can be:
- 		_10_Half	= 0x01
- 		_10_Full	= 0x02
- 		_100_Half	= 0x04
- 		_100_Full	= 0x08
- 		_1000_Full	= 0x10
-  
-  2. Support TBI mode.
-=========================================================================
-VERSION 1.1	<2002/10/4>
+
+RTL8169_VERSION "1.1"	<2002/10/4>
 
 	The bit4:0 of MII register 4 is called "selector field", and have to be
 	00001b to indicate support of IEEE std 802.3 during NWay process of
-	exchanging Link Code Word (FLP). 
+	exchanging Link Code Word (FLP).
 
-VERSION 1.2	<2002/11/30>
+RTL8169_VERSION "1.2"	<2003/6/17>
+	Update driver module name.
+	Modify ISR.
+        Add chip mcfg.
+
+RTL8169_VERSION "1.3"	<2003/6/20>
+        Add chip pcfg.
+	Add priv->phy_timer_t, rtl8169_phy_timer_t_handler()
+	Add rtl8169_hw_PHY_config()
+	Add rtl8169_hw_PHY_reset()
+
+RTL8169_VERSION "1.4"	<2003/7/14>
+	Add tx_bytes, rx_bytes.
+
+RTL8169_VERSION "1.5"	<2003/7/18>
+	Set 0x0000 to PHY at offset 0x0b.
+	Modify chip mcfg, pcfg
+	Force media for multiple card.
+RTL8169_VERSION "1.6"	<2003/8/25>
+	Modify receive data buffer.
+
+RTL8169_VERSION "1.7"	<2003/9/18>
+	Add Jumbo Frame support.
+
+RTL8169_VERSION "1.8"	<2003/10/21>
+	Performance and CPU Utilizaion Enhancement.
+
+RTL8169_VERSION "1.9"	<2003/12/29>
+	Enable Tx/Rx flow control.
+
+RTL8169_VERSION "2.0"	<2004/03/26>
+	Beta version.
+	Support for linux 2.6.x
+
+RTL8169_VERSION "2.1"	<2004/07/05>
+	Modify parameters.
+
+RTL8169_VERSION "2.2"	<2004/08/09>
+	Add.pci_dma_sync_single.
+	Add pci_alloc_consistent()/pci_free_consistent().
+	Revise parameters.
+	Recognize our interrupt for linux 2.6.x.
+*/
 
-	- Large style cleanup
-	- Use ether_crc in stock kernel (linux/crc32.h)
-	- Copy mc_filter setup code from 8139cp
-	  (includes an optimization, and avoids set_bit use)
-
-VERSION 1.6LK	<2004/04/14>
-
-	- Merge of Realtek's version 1.6
-	- Conversion to DMA API
-	- Suspend/resume
-	- Endianness
-	- Misc Rx/Tx bugs
-
-VERSION 2.2LK	<2005/01/25>
-
-	- RX csum, TX csum/SG, TSO
-	- VLAN
-	- baby (< 7200) Jumbo frames support
-	- Merge of Realtek's version 2.2 (new phy)
- */
 
 #include <linux/module.h>
-#include <linux/moduleparam.h>
 #include <linux/pci.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/delay.h>
-#include <linux/ethtool.h>
-#include <linux/mii.h>
-#include <linux/if_vlan.h>
-#include <linux/crc32.h>
-#include <linux/in.h>
-#include <linux/ip.h>
-#include <linux/tcp.h>
+#include <linux/version.h>
+
+#include <linux/timer.h>
 #include <linux/init.h>
-#include <linux/dma-mapping.h>
 
-#include <asm/io.h>
-#include <asm/irq.h>
 
-#define RTL8169_VERSION "2.2LK"
-#define MODULENAME "r8169"
+#define RTL8169_VERSION "2.2"
+#define MODULENAME "RTL8169s/8110s"
+#define RTL8169_DRIVER_NAME   MODULENAME " Gigabit Ethernet driver " RTL8169_VERSION
 #define PFX MODULENAME ": "
 
+
+#undef RTL8169_DEBUG
+#undef RTL8169_JUMBO_FRAME_SUPPORT
+#undef	RTL8169_HW_FLOW_CONTROL_SUPPORT
+
+
+#undef RTL8169_IOCTL_SUPPORT
+#undef RTL8169_DYNAMIC_CONTROL
+#define RTL8169_USE_IO
+
+
 #ifdef RTL8169_DEBUG
-#define assert(expr) \
-        if(!(expr)) {					\
-	        printk( "Assertion failed! %s,%s,%s,line=%d\n",	\
-        	#expr,__FILE__,__FUNCTION__,__LINE__);		\
-        }
-#define dprintk(fmt, args...)	do { printk(PFX fmt, ## args); } while (0)
-#else
-#define assert(expr) do {} while (0)
-#define dprintk(fmt, args...)	do {} while (0)
-#endif /* RTL8169_DEBUG */
-
-#define TX_BUFFS_AVAIL(tp) \
-	(tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1)
-
-#ifdef CONFIG_R8169_NAPI
-#define rtl8169_rx_skb			netif_receive_skb
-#define rtl8169_rx_hwaccel_skb		vlan_hwaccel_rx
-#define rtl8169_rx_quota(count, quota)	min(count, quota)
+	#define assert(expr) \
+        	if(!(expr)) { printk( "Assertion failed! %s,%s,%s,line=%d\n", #expr,__FILE__,__FUNCTION__,__LINE__); }
+	#define DBG_PRINT( fmt, args...)   printk("r8169: " fmt, ## args);
 #else
-#define rtl8169_rx_skb			netif_rx
-#define rtl8169_rx_hwaccel_skb		vlan_hwaccel_receive_skb
-#define rtl8169_rx_quota(count, quota)	count
-#endif
+	#define assert(expr) do {} while (0)
+	#define DBG_PRINT( fmt, args...)   ;
+#endif	// end of #ifdef RTL8169_DEBUG
+
 
 /* media options */
 #define MAX_UNITS 8
-static int media[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 };
-static int num_media = 0;
+static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 /* Maximum events (Rx packets, etc.) to handle at each interrupt. */
 static int max_interrupt_work = 20;
 
 /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
-   The RTL chips use a 64 element hash table based on the Ethernet CRC. */
+   The RTL chips use a 64 element hash table based on the Ethernet CRC.  */
 static int multicast_filter_limit = 32;
 
-/* MAC address length */
-#define MAC_ADDR_LEN	6
+/* MAC address length*/
+#define MAC_ADDR_LEN        6
+
+#define RX_FIFO_THRESH      7       /* 7 means NO threshold, Rx buffer level before first PCI xfer.  */
+#define RX_DMA_BURST        7       /* Maximum PCI burst, '6' is 1024 */
+#define TX_DMA_BURST        7       /* Maximum PCI burst, '6' is 1024 */
+#define ETTh                0x3F    /* 0x3F means NO threshold */
+
+#define ETH_HDR_LEN         14
+#define DEFAULT_MTU         1500
+#define DEFAULT_RX_BUF_LEN  1536
+
+
+#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+#define MAX_JUMBO_FRAME_MTU	( 10000 )
+#define MAX_RX_SKBDATA_SIZE	( MAX_JUMBO_FRAME_MTU + ETH_HDR_LEN )
+#else
+#define MAX_RX_SKBDATA_SIZE 1600
+#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+
+#define InterFrameGap       0x03    /* 3 means InterFrameGap = the shortest one */
 
-#define RX_FIFO_THRESH	7	/* 7 means NO threshold, Rx buffer level before first PCI xfer. */
-#define RX_DMA_BURST	6	/* Maximum PCI burst, '6' is 1024 */
-#define TX_DMA_BURST	6	/* Maximum PCI burst, '6' is 1024 */
-#define EarlyTxThld 	0x3F	/* 0x3F means NO early transmit */
-#define RxPacketMaxSize	0x3FE8	/* 16K - 1 - ETH_HLEN - VLAN - CRC... */
-#define SafeMtu		0x1c20	/* ... actually life sucks beyond ~7k */
-#define InterFrameGap	0x03	/* 3 means InterFrameGap = the shortest one */
-
-#define R8169_REGS_SIZE		256
-#define R8169_NAPI_WEIGHT	64
-#define NUM_TX_DESC	64	/* Number of Tx descriptor registers */
-#define NUM_RX_DESC	256	/* Number of Rx descriptor registers */
-#define RX_BUF_SIZE	1536	/* Rx Buffer size */
-#define R8169_TX_RING_BYTES	(NUM_TX_DESC * sizeof(struct TxDesc))
-#define R8169_RX_RING_BYTES	(NUM_RX_DESC * sizeof(struct RxDesc))
+#define NUM_TX_DESC         64     /* Number of Tx descriptor registers*/
+#define NUM_RX_DESC         64     /* Number of Rx descriptor registers*/
 
-#define RTL8169_TX_TIMEOUT	(6*HZ)
-#define RTL8169_PHY_TIMEOUT	(10*HZ)
 
+#define RTL_MIN_IO_SIZE     0x80
+#define TX_TIMEOUT          (6*HZ)
+#define RTL8169_TIMER_EXPIRE_TIME 100 //100
+
+
+#ifdef RTL8169_USE_IO
+#define RTL_W8(reg, val8)   outb ((val8), ioaddr + (reg))
+#define RTL_W16(reg, val16) outw ((val16), ioaddr + (reg))
+#define RTL_W32(reg, val32) outl ((val32), ioaddr + (reg))
+#define RTL_R8(reg)         inb (ioaddr + (reg))
+#define RTL_R16(reg)        inw (ioaddr + (reg))
+#define RTL_R32(reg)        ((unsigned long) inl (ioaddr + (reg)))
+#else
 /* write/read MMIO register */
-#define RTL_W8(reg, val8)	writeb ((val8), ioaddr + (reg))
-#define RTL_W16(reg, val16)	writew ((val16), ioaddr + (reg))
-#define RTL_W32(reg, val32)	writel ((val32), ioaddr + (reg))
-#define RTL_R8(reg)		readb (ioaddr + (reg))
-#define RTL_R16(reg)		readw (ioaddr + (reg))
-#define RTL_R32(reg)		((unsigned long) readl (ioaddr + (reg)))
-
-enum mac_version {
-	RTL_GIGA_MAC_VER_B = 0x00,
-	/* RTL_GIGA_MAC_VER_C = 0x03, */
-	RTL_GIGA_MAC_VER_D = 0x01,
-	RTL_GIGA_MAC_VER_E = 0x02,
-	RTL_GIGA_MAC_VER_X = 0x04	/* Greater than RTL_GIGA_MAC_VER_E */
-};
+#define RTL_W8(reg, val8)   writeb ((val8), ioaddr + (reg))
+#define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg))
+#define RTL_W32(reg, val32) writel ((val32), ioaddr + (reg))
+#define RTL_R8(reg)         readb (ioaddr + (reg))
+#define RTL_R16(reg)        readw (ioaddr + (reg))
+#define RTL_R32(reg)        ((unsigned long) readl (ioaddr + (reg)))
+#endif
 
-enum phy_version {
-	RTL_GIGA_PHY_VER_C = 0x03, /* PHY Reg 0x03 bit0-3 == 0x0000 */
-	RTL_GIGA_PHY_VER_D = 0x04, /* PHY Reg 0x03 bit0-3 == 0x0000 */
-	RTL_GIGA_PHY_VER_E = 0x05, /* PHY Reg 0x03 bit0-3 == 0x0000 */
-	RTL_GIGA_PHY_VER_F = 0x06, /* PHY Reg 0x03 bit0-3 == 0x0001 */
-	RTL_GIGA_PHY_VER_G = 0x07, /* PHY Reg 0x03 bit0-3 == 0x0002 */
-	RTL_GIGA_PHY_VER_H = 0x08, /* PHY Reg 0x03 bit0-3 == 0x0003 */
-};
+#define MCFG_METHOD_1		0x01
+#define MCFG_METHOD_2		0x02
+#define MCFG_METHOD_3		0x03
+#define MCFG_METHOD_4		0x04
+
+#define PCFG_METHOD_1		0x01	//PHY Reg 0x03 bit0-3 == 0x0000
+#define PCFG_METHOD_2		0x02	//PHY Reg 0x03 bit0-3 == 0x0001
+#define PCFG_METHOD_3		0x03	//PHY Reg 0x03 bit0-3 == 0x0002
 
 
-#define _R(NAME,MAC,MASK) \
-	{ .name = NAME, .mac_version = MAC, .RxConfigMask = MASK }
+#ifdef RTL8169_DYNAMIC_CONTROL
+#include "r8169_callback.h"
+#endif  //end #ifdef RTL8169_DYNAMIC_CONTROL
+
 
 const static struct {
 	const char *name;
-	u8 mac_version;
-	u32 RxConfigMask;	/* Clears the bits supported by this chip */
+	u8 mcfg;		 /* depend on RTL8169 docs */
+	u32 RxConfigMask; 	/* should clear the bits supported by this chip */
 } rtl_chip_info[] = {
-	_R("RTL8169",		RTL_GIGA_MAC_VER_B, 0xff7e1880),
-	_R("RTL8169s/8110s",	RTL_GIGA_MAC_VER_D, 0xff7e1880),
-	_R("RTL8169s/8110s",	RTL_GIGA_MAC_VER_E, 0xff7e1880),
-	_R("RTL8169s/8110s",	RTL_GIGA_MAC_VER_X, 0xff7e1880),
+	{ "RTL8169",  MCFG_METHOD_1,  0xff7e1880 },
+	{ "RTL8169s/8110s",  MCFG_METHOD_2,  0xff7e1880 },
+	{ "RTL8169s/8110s",  MCFG_METHOD_3,  0xff7e1880 },
 };
-#undef _R
 
-static struct pci_device_id rtl8169_pci_tbl[] = {
-	{0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{0x1186, 0x4300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+
+static struct pci_device_id rtl8169_pci_tbl[] __devinitdata = {
+	{ 0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+#ifdef CONFIG_IOMEGA8241	
+	/* The 8169 without an i2c defaults to reporting as an 8129 */
+	{ 0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+#endif /* CONFIG_IOMEGA8241 */		
 	{0,},
 };
 
-MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);
 
-static int rx_copybreak = 200;
-static int use_dac;
+MODULE_DEVICE_TABLE (pci, rtl8169_pci_tbl);
+
 
 enum RTL8169_registers {
-	MAC0 = 0,		/* Ethernet hardware address. */
-	MAR0 = 8,		/* Multicast filter. */
-	TxDescStartAddrLow = 0x20,
-	TxDescStartAddrHigh = 0x24,
-	TxHDescStartAddrLow = 0x28,
-	TxHDescStartAddrHigh = 0x2c,
-	FLASH = 0x30,
-	ERSR = 0x36,
-	ChipCmd = 0x37,
-	TxPoll = 0x38,
+	MAC0 = 0x0,
+	MAR0 = 0x8,
+	TxDescStartAddr	= 0x20,
+	TxHDescStartAddr= 0x28,
+	FLASH	= 0x30,
+	ERSR	= 0x36,
+	ChipCmd	= 0x37,
+	TxPoll	= 0x38,
 	IntrMask = 0x3C,
 	IntrStatus = 0x3E,
 	TxConfig = 0x40,
 	RxConfig = 0x44,
 	RxMissed = 0x4C,
 	Cfg9346 = 0x50,
-	Config0 = 0x51,
-	Config1 = 0x52,
-	Config2 = 0x53,
-	Config3 = 0x54,
-	Config4 = 0x55,
-	Config5 = 0x56,
+	Config0	= 0x51,
+	Config1	= 0x52,
+	Config2	= 0x53,
+	Config3	= 0x54,
+	Config4	= 0x55,
+	Config5	= 0x56,
 	MultiIntr = 0x5C,
-	PHYAR = 0x60,
-	TBICSR = 0x64,
+	PHYAR	= 0x60,
+	TBICSR	= 0x64,
 	TBI_ANAR = 0x68,
 	TBI_LPAR = 0x6A,
 	PHYstatus = 0x6C,
 	RxMaxSize = 0xDA,
 	CPlusCmd = 0xE0,
-	IntrMitigate = 0xE2,
-	RxDescAddrLow = 0xE4,
-	RxDescAddrHigh = 0xE8,
-	EarlyTxThres = 0xEC,
-	FuncEvent = 0xF0,
-	FuncEventMask = 0xF4,
-	FuncPresetState = 0xF8,
-	FuncForceEvent = 0xFC,
+	RxDescStartAddr	= 0xE4,
+	ETThReg	= 0xEC,
+	FuncEvent	= 0xF0,
+	FuncEventMask	= 0xF4,
+	FuncPresetState	= 0xF8,
+	FuncForceEvent	= 0xFC,
 };
 
 enum RTL8169_register_content {
-	/* InterruptStatusBits */
-	SYSErr = 0x8000,
-	PCSTimeout = 0x4000,
-	SWInt = 0x0100,
-	TxDescUnavail = 0x80,
-	RxFIFOOver = 0x40,
-	LinkChg = 0x20,
-	RxOverflow = 0x10,
-	TxErr = 0x08,
-	TxOK = 0x04,
-	RxErr = 0x02,
-	RxOK = 0x01,
+	/*InterruptStatusBits*/
+	SYSErr 		= 0x8000,
+	PCSTimeout	= 0x4000,
+	SWInt		= 0x0100,
+	TxDescUnavail	= 0x80,
+	RxFIFOOver 	= 0x40,
+	LinkChg 	= 0x20,
+	RxOverflow 	= 0x10,
+	TxErr 	= 0x08,
+	TxOK 	= 0x04,
+	RxErr 	= 0x02,
+	RxOK 	= 0x01,
 
-	/* RxStatusDesc */
+	/*RxStatusDesc*/
 	RxRES = 0x00200000,
 	RxCRC = 0x00080000,
-	RxRUNT = 0x00100000,
+	RxRUNT= 0x00100000,
 	RxRWT = 0x00400000,
 
-	/* ChipCmdBits */
+	/*ChipCmdBits*/
 	CmdReset = 0x10,
 	CmdRxEnb = 0x08,
 	CmdTxEnb = 0x04,
 	RxBufEmpty = 0x01,
 
-	/* Cfg9346Bits */
+	/*Cfg9346Bits*/
 	Cfg9346_Lock = 0x00,
 	Cfg9346_Unlock = 0xC0,
 
-	/* rx_mode_bits */
+	/*rx_mode_bits*/
 	AcceptErr = 0x20,
 	AcceptRunt = 0x10,
 	AcceptBroadcast = 0x08,
@@ -263,2280 +270,1646 @@
 	AcceptMyPhys = 0x02,
 	AcceptAllPhys = 0x01,
 
-	/* RxConfigBits */
+	/*RxConfigBits*/
 	RxCfgFIFOShift = 13,
 	RxCfgDMAShift = 8,
 
-	/* TxConfigBits */
+	/*TxConfigBits*/
 	TxInterFrameGapShift = 24,
-	TxDMAShift = 8,	/* DMA burst value (0-7) is shift this many bits */
+	TxDMAShift = 8,
 
-	/* TBICSR p.28 */
-	TBIReset	= 0x80000000,
-	TBILoopback	= 0x40000000,
-	TBINwEnable	= 0x20000000,
-	TBINwRestart	= 0x10000000,
-	TBILinkOk	= 0x02000000,
-	TBINwComplete	= 0x01000000,
-
-	/* CPlusCmd p.31 */
-	RxVlan		= (1 << 6),
-	RxChkSum	= (1 << 5),
-	PCIDAC		= (1 << 4),
-	PCIMulRW	= (1 << 3),
-
-	/* rtl8169_PHYstatus */
-	TBI_Enable = 0x80,
-	TxFlowCtrl = 0x40,
-	RxFlowCtrl = 0x20,
-	_1000bpsF = 0x10,
-	_100bps = 0x08,
-	_10bps = 0x04,
-	LinkStatus = 0x02,
-	FullDup = 0x01,
+	/*rtl8169_PHYstatus*/
+	TBI_Enable	= 0x80,
+	TxFlowCtrl	= 0x40,
+	RxFlowCtrl	= 0x20,
+	_1000bpsF	= 0x10,
+	_100bps		= 0x08,
+	_10bps		= 0x04,
+	LinkStatus	= 0x02,
+	FullDup		= 0x01,
 
-	/* GIGABIT_PHY_registers */
+	/*GIGABIT_PHY_registers*/
 	PHY_CTRL_REG = 0,
 	PHY_STAT_REG = 1,
 	PHY_AUTO_NEGO_REG = 4,
 	PHY_1000_CTRL_REG = 9,
 
-	/* GIGABIT_PHY_REG_BIT */
-	PHY_Restart_Auto_Nego = 0x0200,
-	PHY_Enable_Auto_Nego = 0x1000,
-
-	/* PHY_STAT_REG = 1 */
-	PHY_Auto_Neco_Comp = 0x0020,
-
-	/* PHY_AUTO_NEGO_REG = 4 */
-	PHY_Cap_10_Half = 0x0020,
-	PHY_Cap_10_Full = 0x0040,
-	PHY_Cap_100_Half = 0x0080,
-	PHY_Cap_100_Full = 0x0100,
-
-	/* PHY_1000_CTRL_REG = 9 */
-	PHY_Cap_1000_Full = 0x0200,
-
-	PHY_Cap_Null = 0x0,
-
-	/* _MediaType */
-	_10_Half = 0x01,
-	_10_Full = 0x02,
-	_100_Half = 0x04,
-	_100_Full = 0x08,
-	_1000_Full = 0x10,
+	/*GIGABIT_PHY_REG_BIT*/
+	PHY_Restart_Auto_Nego	= 0x0200,
+	PHY_Enable_Auto_Nego	= 0x1000,
+
+	//PHY_STAT_REG = 1;
+	PHY_Auto_Neco_Comp	= 0x0020,
+
+	//PHY_AUTO_NEGO_REG = 4;
+	PHY_Cap_10_Half		= 0x0020,
+	PHY_Cap_10_Full		= 0x0040,
+	PHY_Cap_100_Half	= 0x0080,
+	PHY_Cap_100_Full	= 0x0100,
+
+	//PHY_1000_CTRL_REG = 9;
+	PHY_Cap_1000_Full	= 0x0200,
+
+	PHY_Cap_PAUSE		= 0x0400,
+	PHY_Cap_ASYM_PAUSE	= 0x0800,
+
+	PHY_Cap_Null		= 0x0,
+
+	/*_MediaType*/
+	_10_Half	= 0x01,
+	_10_Full	= 0x02,
+	_100_Half	= 0x04,
+	_100_Full	= 0x08,
+	_1000_Full	= 0x10,
 
-	/* _TBICSRBit */
-	TBILinkOK = 0x02000000,
+	/*_TBICSRBit*/
+	TBILinkOK 	= 0x02000000,
 };
 
+
+
 enum _DescStatusBit {
-	DescOwn		= (1 << 31), /* Descriptor is owned by NIC */
-	RingEnd		= (1 << 30), /* End of descriptor ring */
-	FirstFrag	= (1 << 29), /* First segment of a packet */
-	LastFrag	= (1 << 28), /* Final segment of a packet */
-
-	/* Tx private */
-	LargeSend	= (1 << 27), /* TCP Large Send Offload (TSO) */
-	MSSShift	= 16,        /* MSS value position */
-	MSSMask		= 0xfff,     /* MSS value + LargeSend bit: 12 bits */
-	IPCS		= (1 << 18), /* Calculate IP checksum */
-	UDPCS		= (1 << 17), /* Calculate UDP/IP checksum */
-	TCPCS		= (1 << 16), /* Calculate TCP/IP checksum */
-	TxVlanTag	= (1 << 17), /* Add VLAN tag */
-
-	/* Rx private */
-	PID1		= (1 << 18), /* Protocol ID bit 1/2 */
-	PID0		= (1 << 17), /* Protocol ID bit 2/2 */
-
-#define RxProtoUDP	(PID1)
-#define RxProtoTCP	(PID0)
-#define RxProtoIP	(PID1 | PID0)
-#define RxProtoMask	RxProtoIP
-
-	IPFail		= (1 << 16), /* IP checksum failed */
-	UDPFail		= (1 << 15), /* UDP/IP checksum failed */
-	TCPFail		= (1 << 14), /* TCP/IP checksum failed */
-	RxVlanTag	= (1 << 16), /* VLAN tag available */
+	OWNbit	= 0x80000000,
+	EORbit	= 0x40000000,
+	FSbit	= 0x20000000,
+	LSbit	= 0x10000000,
 };
 
-#define RsvdMask	0x3fffc000
 
 struct TxDesc {
-	u32 opts1;
-	u32 opts2;
-	u64 addr;
+	u32		status;
+	u32		vlan_tag;
+	u32		buf_addr;
+	u32		buf_Haddr;
 };
 
 struct RxDesc {
-	u32 opts1;
-	u32 opts2;
-	u64 addr;
+	u32		status;
+	u32		vlan_tag;
+	u32		buf_addr;
+	u32		buf_Haddr;
 };
 
-struct ring_info {
-	struct sk_buff	*skb;
-	u32		len;
-	u8		__pad[sizeof(void *) - sizeof(u32)];
-};
+
+typedef struct timer_list rt_timer_t;
+
 
 struct rtl8169_private {
-	void __iomem *mmio_addr;	/* memory map physical address */
-	struct pci_dev *pci_dev;	/* Index of PCI device */
-	struct net_device_stats stats;	/* statistics of net device */
-	spinlock_t lock;		/* spin lock flag */
+	unsigned long ioaddr;                /* memory map physical address*/
+	struct pci_dev *pci_dev;                /* Index of PCI device  */
+	struct net_device_stats stats;          /* statistics of net device */
+	spinlock_t lock;                        /* spin lock flag */
 	int chipset;
-	int mac_version;
-	int phy_version;
-	u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */
-	u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */
-	u32 dirty_rx;
-	u32 dirty_tx;
-	struct TxDesc *TxDescArray;	/* 256-aligned Tx descriptor ring */
-	struct RxDesc *RxDescArray;	/* 256-aligned Rx descriptor ring */
-	dma_addr_t TxPhyAddr;
-	dma_addr_t RxPhyAddr;
-	struct sk_buff *Rx_skbuff[NUM_RX_DESC];	/* Rx data buffers */
-	struct ring_info tx_skb[NUM_TX_DESC];	/* Tx data buffers */
-	unsigned rx_buf_sz;
-	struct timer_list timer;
-	u16 cp_cmd;
-	u16 intr_mask;
-	int phy_auto_nego_reg;
-	int phy_1000_ctrl_reg;
-#ifdef CONFIG_R8169_VLAN
-	struct vlan_group *vlgrp;
-#endif
-	int (*set_speed)(struct net_device *, u8 autoneg, u16 speed, u8 duplex);
-	void (*get_settings)(struct net_device *, struct ethtool_cmd *);
-	void (*phy_reset_enable)(void __iomem *);
-	unsigned int (*phy_reset_pending)(void __iomem *);
-	unsigned int (*link_ok)(void __iomem *);
-	struct work_struct task;
+	int mcfg;
+	int pcfg;
+	rt_timer_t r8169_timer;
+	unsigned long expire_time;
+
+	unsigned long phy_link_down_cnt;
+	unsigned long cur_rx;                   /* Index into the Rx descriptor buffer of next Rx pkt. */
+	unsigned long cur_tx;                   /* Index into the Tx descriptor buffer of next Rx pkt. */
+	unsigned long dirty_tx;
+	struct	TxDesc	*TxDescArray;           /* Index of 256-alignment Tx Descriptor buffer */
+	struct	RxDesc	*RxDescArray;           /* Index of 256-alignment Rx Descriptor buffer */
+	struct	sk_buff	*Tx_skbuff[NUM_TX_DESC];/* Index of Transmit data buffer */
+	struct	sk_buff	*Rx_skbuff[NUM_RX_DESC];/* Receive data buffer */
+	unsigned char   drvinit_fail;
+
+	dma_addr_t txdesc_array_dma_addr[NUM_TX_DESC];
+	dma_addr_t rxdesc_array_dma_addr[NUM_RX_DESC];
+	dma_addr_t rx_skbuff_dma_addr[NUM_RX_DESC];
+
+	void *txdesc_space;
+	dma_addr_t txdesc_phy_dma_addr;
+	int sizeof_txdesc_space;
+
+	void *rxdesc_space;
+	dma_addr_t rxdesc_phy_dma_addr;
+	int sizeof_rxdesc_space;
+
+	int curr_mtu_size;
+	int tx_pkt_len;
+	int rx_pkt_len;
+
+	int hw_rx_pkt_len;
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+	struct r8169_cb_t rt;
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+	unsigned char   linkstatus;
 };
 
-MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
-MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
-module_param_array(media, int, &num_media, 0);
-module_param(rx_copybreak, int, 0);
-module_param(use_dac, int, 0);
-MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
+
+MODULE_AUTHOR ("Realtek");
+MODULE_DESCRIPTION ("RealTek RTL-8169 Gigabit Ethernet driver");
+MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(RTL8169_VERSION);
 
-static int rtl8169_open(struct net_device *dev);
-static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance,
-			      struct pt_regs *regs);
-static int rtl8169_init_ring(struct net_device *dev);
-static void rtl8169_hw_start(struct net_device *dev);
-static int rtl8169_close(struct net_device *dev);
-static void rtl8169_set_rx_mode(struct net_device *dev);
-static void rtl8169_tx_timeout(struct net_device *dev);
-static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev);
-static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *,
-				void __iomem *);
-static int rtl8169_change_mtu(struct net_device *netdev, int new_mtu);
-static void rtl8169_down(struct net_device *dev);
 
-#ifdef CONFIG_R8169_NAPI
-static int rtl8169_poll(struct net_device *dev, int *budget);
+static int rtl8169_open (struct net_device *dev);
+static int rtl8169_start_xmit (struct sk_buff *skb, struct net_device *dev);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+typedef	int				irqreturn_t;
+#define	IRQ_NONE		0
+#define	IRQ_HANDLED		1
+static void rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
+#else
+static irqreturn_t rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
 #endif
 
-static const u16 rtl8169_intr_mask =
-	SYSErr | LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK;
-static const u16 rtl8169_napi_event =
-	RxOK | RxOverflow | RxFIFOOver | TxOK | TxErr;
-static const unsigned int rtl8169_rx_config =
-    (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift);
-
-#define PHY_Cap_10_Half_Or_Less PHY_Cap_10_Half
-#define PHY_Cap_10_Full_Or_Less PHY_Cap_10_Full | PHY_Cap_10_Half_Or_Less
-#define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less
-#define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less
+static void rtl8169_init_ring (struct net_device *dev);
+static void rtl8169_hw_start (struct net_device *dev);
+static int rtl8169_close (struct net_device *dev);
+static inline u32 ether_crc (int length, unsigned char *data);
+static void rtl8169_set_rx_mode (struct net_device *dev);
+static void rtl8169_tx_timeout (struct net_device *dev);
+static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev);
+
+#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+static int rtl8169_change_mtu(struct net_device *dev, int new_mtu);
+#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+static void rtl8169_hw_PHY_config (struct net_device *dev);
+static void rtl8169_hw_PHY_reset(struct net_device *dev);
+static const u16 rtl8169_intr_mask = LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK ;
+static const unsigned int rtl8169_rx_config = (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift) | 0x0000000E;
+
+
+#define RTL8169_WRITE_GMII_REG_BIT( ioaddr, reg, bitnum, bitval )\
+{ \
+	int val; \
+	if( bitval == 1 ){ val = ( RTL8169_READ_GMII_REG( ioaddr, reg ) | (bitval<<bitnum) ) & 0xffff ; } \
+	else{ val = ( RTL8169_READ_GMII_REG( ioaddr, reg ) & (~(0x0001<<bitnum)) ) & 0xffff ; } \
+	RTL8169_WRITE_GMII_REG( ioaddr, reg, val ); \
+}
+
+
+
+#ifdef RTL8169_DEBUG
+unsigned alloc_rxskb_cnt = 0;
+#define RTL8169_ALLOC_RXSKB(bufsize) 	dev_alloc_skb(bufsize); alloc_rxskb_cnt ++ ;
+#define RTL8169_FREE_RXSKB(skb) 	kfree_skb(skb); alloc_rxskb_cnt -- ;
+#define RTL8169_NETIF_RX(skb) 		netif_rx(skb); alloc_rxskb_cnt -- ;
+#else
+#define RTL8169_ALLOC_RXSKB(bufsize) 	dev_alloc_skb(bufsize);
+#define RTL8169_FREE_RXSKB(skb) 	kfree_skb(skb);
+#define RTL8169_NETIF_RX(skb) 		netif_rx(skb);
+#endif //end #ifdef RTL8169_DEBUG
+
+
+
 
-static void mdio_write(void __iomem *ioaddr, int RegAddr, int value)
+
+
+//=================================================================
+//	PHYAR
+//	bit		Symbol
+//	31		Flag
+//	30-21	reserved
+//	20-16	5-bit GMII/MII register address
+//	15-0	16-bit GMII/MII register data
+//=================================================================
+void RTL8169_WRITE_GMII_REG( unsigned long ioaddr, int RegAddr, int value )
 {
-	int i;
+	int	i;
 
-	RTL_W32(PHYAR, 0x80000000 | (RegAddr & 0xFF) << 16 | value);
+	RTL_W32 ( PHYAR, 0x80000000 | (RegAddr&0xFF)<<16 | value);
 	udelay(1000);
 
-	for (i = 2000; i > 0; i--) {
-		/* Check if the RTL8169 has completed writing to the specified MII register */
-		if (!(RTL_R32(PHYAR) & 0x80000000)) 
+	for( i = 2000; i > 0 ; i -- ){
+		// Check if the RTL8169 has completed writing to the specified MII register
+		if( ! (RTL_R32(PHYAR)&0x80000000) ){
 			break;
-		udelay(100);
-	}
+		}
+		else{
+			udelay(100);
+		}// end of if( ! (RTL_R32(PHYAR)&0x80000000) )
+	}// end of for() loop
 }
-
-static int mdio_read(void __iomem *ioaddr, int RegAddr)
+//=================================================================
+int RTL8169_READ_GMII_REG( unsigned long ioaddr, int RegAddr )
 {
 	int i, value = -1;
 
-	RTL_W32(PHYAR, 0x0 | (RegAddr & 0xFF) << 16);
+	RTL_W32 ( PHYAR, 0x0 | (RegAddr&0xFF)<<16 );
 	udelay(1000);
 
-	for (i = 2000; i > 0; i--) {
-		/* Check if the RTL8169 has completed retrieving data from the specified MII register */
-		if (RTL_R32(PHYAR) & 0x80000000) {
-			value = (int) (RTL_R32(PHYAR) & 0xFFFF);
+	for( i = 2000; i > 0 ; i -- ){
+		// Check if the RTL8169 has completed retrieving data from the specified MII register
+		if( RTL_R32(PHYAR) & 0x80000000 ){
+			value = (int)( RTL_R32(PHYAR)&0xFFFF );
 			break;
 		}
-		udelay(100);
-	}
+		else{
+			udelay(100);
+		}// end of if( RTL_R32(PHYAR) & 0x80000000 )
+	}// end of for() loop
 	return value;
 }
 
-static void rtl8169_irq_mask_and_ack(void __iomem *ioaddr)
-{
-	RTL_W16(IntrMask, 0x0000);
 
-	RTL_W16(IntrStatus, 0xffff);
-}
+#ifdef RTL8169_IOCTL_SUPPORT
+#include "r8169_ioctl.c"
+#endif //end #ifdef RTL8169_IOCTL_SUPPORT
 
-static void rtl8169_asic_down(void __iomem *ioaddr)
-{
-	RTL_W8(ChipCmd, 0x00);
-	rtl8169_irq_mask_and_ack(ioaddr);
-	RTL_R16(CPlusCmd);
-}
 
-static unsigned int rtl8169_tbi_reset_pending(void __iomem *ioaddr)
-{
-	return RTL_R32(TBICSR) & TBIReset;
-}
+#ifdef RTL8169_DYNAMIC_CONTROL
+#include "r8169_callback.c"
+#endif
 
-static unsigned int rtl8169_xmii_reset_pending(void __iomem *ioaddr)
-{
-	return mdio_read(ioaddr, 0) & 0x8000;
-}
 
-static unsigned int rtl8169_tbi_link_ok(void __iomem *ioaddr)
-{
-	return RTL_R32(TBICSR) & TBILinkOk;
+
+#define rtl8169_request_timer( timer, timer_expires, timer_func, timer_data ) \
+{ \
+	init_timer(timer); \
+	timer->expires = (unsigned long)(jiffies + timer_expires); \
+	timer->data = (unsigned long)(timer_data); \
+	timer->function = (void *)(timer_func); \
+	add_timer(timer); \
+	DBG_PRINT("request_timer at 0x%08lx\n", (unsigned long)timer); \
 }
 
-static unsigned int rtl8169_xmii_link_ok(void __iomem *ioaddr)
-{
-	return RTL_R8(PHYstatus) & LinkStatus;
+#define rtl8169_delete_timer( del_timer_t ) \
+{ \
+	del_timer(del_timer_t); \
+	DBG_PRINT("delete_timer at 0x%08lx\n", (unsigned long)del_timer_t); \
 }
 
-static void rtl8169_tbi_reset_enable(void __iomem *ioaddr)
-{
-	RTL_W32(TBICSR, RTL_R32(TBICSR) | TBIReset);
+#define rtl8169_mod_timer( timer, timer_expires ) \
+{ \
+	mod_timer( timer, jiffies + timer_expires ); \
 }
 
-static void rtl8169_xmii_reset_enable(void __iomem *ioaddr)
-{
-	unsigned int val;
 
-	val = (mdio_read(ioaddr, PHY_CTRL_REG) | 0x8000) & 0xffff;
-	mdio_write(ioaddr, PHY_CTRL_REG, val);
-}
 
-static void rtl8169_check_link_status(struct net_device *dev,
-				      struct rtl8169_private *tp, void __iomem *ioaddr)
-{
-	unsigned long flags;
 
-	spin_lock_irqsave(&tp->lock, flags);
-	if (tp->link_ok(ioaddr)) {
-		netif_carrier_on(dev);
-		printk(KERN_INFO PFX "%s: link up\n", dev->name);
-	} else
-		netif_carrier_off(dev);
-	spin_unlock_irqrestore(&tp->lock, flags);
-}
-
-static void rtl8169_link_option(int idx, u8 *autoneg, u16 *speed, u8 *duplex)
-{
-	struct {
-		u16 speed;
-		u8 duplex;
-		u8 autoneg;
-		u8 media;
-	} link_settings[] = {
-		{ SPEED_10,	DUPLEX_HALF, AUTONEG_DISABLE,	_10_Half },
-		{ SPEED_10,	DUPLEX_FULL, AUTONEG_DISABLE,	_10_Full },
-		{ SPEED_100,	DUPLEX_HALF, AUTONEG_DISABLE,	_100_Half },
-		{ SPEED_100,	DUPLEX_FULL, AUTONEG_DISABLE,	_100_Full },
-		{ SPEED_1000,	DUPLEX_FULL, AUTONEG_DISABLE,	_1000_Full },
-		/* Make TBI happy */
-		{ SPEED_1000,	DUPLEX_FULL, AUTONEG_ENABLE,	0xff }
-	}, *p;
-	unsigned char option;
-	
-	option = ((idx < MAX_UNITS) && (idx >= 0)) ? media[idx] : 0xff;
+//======================================================================================================
+//======================================================================================================
+void rtl8169_phy_timer_t_handler( void	*timer_data )
+{
+	struct net_device *dev = (struct net_device *)timer_data;
+	struct rtl8169_private *priv = (struct rtl8169_private *) (dev->priv);
+	unsigned long ioaddr = priv->ioaddr;
 
-	if ((option != 0xff) && !idx)
-		printk(KERN_WARNING PFX "media option is deprecated.\n");
+	assert( priv->mcfg > MCFG_METHOD_1 );
+	assert( priv->pcfg < PCFG_METHOD_3 );
 
-	for (p = link_settings; p->media != 0xff; p++) {
-		if (p->media == option)
-			break;
+	if( RTL_R8(PHYstatus) & LinkStatus ){
+		priv->phy_link_down_cnt = 0 ;
 	}
-	*autoneg = p->autoneg;
-	*speed = p->speed;
-	*duplex = p->duplex;
-}
+	else{
+		priv->phy_link_down_cnt ++ ;
+		if( priv->phy_link_down_cnt >= 12 ){
+			// If link on 1000, perform phy reset.
+			if( RTL8169_READ_GMII_REG( ioaddr, PHY_1000_CTRL_REG ) & PHY_Cap_1000_Full )
+			{
+				DBG_PRINT("rtl8169_hw_PHY_reset\n");
+				rtl8169_hw_PHY_reset( dev );
+			}
 
-static void rtl8169_get_drvinfo(struct net_device *dev,
-				struct ethtool_drvinfo *info)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
+			priv->phy_link_down_cnt = 0 ;
+		}
+	}
 
-	strcpy(info->driver, MODULENAME);
-	strcpy(info->version, RTL8169_VERSION);
-	strcpy(info->bus_info, pci_name(tp->pci_dev));
+	//---------------------------------------------------------------------------
+	//mod_timer is a more efficient way to update the expire field of an active timer.
+	//---------------------------------------------------------------------------
+//	rtl8169_mod_timer( (&priv->phy_timer_t), 100 );
 }
 
-static int rtl8169_get_regs_len(struct net_device *dev)
-{
-	return R8169_REGS_SIZE;
-}
 
-static int rtl8169_set_speed_tbi(struct net_device *dev,
-				 u8 autoneg, u16 speed, u8 duplex)
+
+//======================================================================================================
+//======================================================================================================
+void rtl8169_timer_handler( void *timer_data )
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	int ret = 0;
-	u32 reg;
+	struct net_device *dev = (struct net_device *)timer_data;
+	struct rtl8169_private *priv = (struct rtl8169_private *) (dev->priv);
 
-	reg = RTL_R32(TBICSR);
-	if ((autoneg == AUTONEG_DISABLE) && (speed == SPEED_1000) &&
-	    (duplex == DUPLEX_FULL)) {
-		RTL_W32(TBICSR, reg & ~(TBINwEnable | TBINwRestart));
-	} else if (autoneg == AUTONEG_ENABLE)
-		RTL_W32(TBICSR, reg | TBINwEnable | TBINwRestart);
-	else {
-		printk(KERN_WARNING PFX
-		       "%s: incorrect speed setting refused in TBI mode\n",
-		       dev->name);
-		ret = -EOPNOTSUPP;
+	if( (priv->mcfg > MCFG_METHOD_1) && (priv->pcfg < PCFG_METHOD_3) ){
+		DBG_PRINT("FIX PCS -> rtl8169_phy_timer_t_handler\n");
+		priv->phy_link_down_cnt = 0;
+		rtl8169_phy_timer_t_handler( timer_data );
 	}
 
-	return ret;
-}
 
-static int rtl8169_set_speed_xmii(struct net_device *dev,
-				  u8 autoneg, u16 speed, u8 duplex)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	int auto_nego, giga_ctrl;
+#ifdef RTL8169_DYNAMIC_CONTROL
+	{
+		struct r8169_cb_t *rt = &(priv->rt);
+		if( priv->linkstatus == _1000_Full ){
+			r8169_callback(rt);
+		}
+	}
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
 
-	auto_nego = mdio_read(ioaddr, PHY_AUTO_NEGO_REG);
-	auto_nego &= ~(PHY_Cap_10_Half | PHY_Cap_10_Full |
-		       PHY_Cap_100_Half | PHY_Cap_100_Full);
-	giga_ctrl = mdio_read(ioaddr, PHY_1000_CTRL_REG);
-	giga_ctrl &= ~(PHY_Cap_1000_Full | PHY_Cap_Null);
 
-	if (autoneg == AUTONEG_ENABLE) {
-		auto_nego |= (PHY_Cap_10_Half | PHY_Cap_10_Full |
-			      PHY_Cap_100_Half | PHY_Cap_100_Full);
-		giga_ctrl |= PHY_Cap_1000_Full;
-	} else {
-		if (speed == SPEED_10)
-			auto_nego |= PHY_Cap_10_Half | PHY_Cap_10_Full;
-		else if (speed == SPEED_100)
-			auto_nego |= PHY_Cap_100_Half | PHY_Cap_100_Full;
-		else if (speed == SPEED_1000)
-			giga_ctrl |= PHY_Cap_1000_Full;
-
-		if (duplex == DUPLEX_HALF)
-			auto_nego &= ~(PHY_Cap_10_Full | PHY_Cap_100_Full);
-	}
-
-	tp->phy_auto_nego_reg = auto_nego;
-	tp->phy_1000_ctrl_reg = giga_ctrl;
-
-	mdio_write(ioaddr, PHY_AUTO_NEGO_REG, auto_nego);
-	mdio_write(ioaddr, PHY_1000_CTRL_REG, giga_ctrl);
-	mdio_write(ioaddr, PHY_CTRL_REG, PHY_Enable_Auto_Nego |
-					 PHY_Restart_Auto_Nego);
-	return 0;
+	rtl8169_mod_timer( (&priv->r8169_timer), priv->expire_time );
 }
 
-static int rtl8169_set_speed(struct net_device *dev,
-			     u8 autoneg, u16 speed, u8 duplex)
+
+
+//======================================================================================================
+//======================================================================================================
+static int __devinit rtl8169_init_board ( struct pci_dev *pdev, struct net_device **dev_out, unsigned long *ioaddr_out)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
-	int ret;
+	unsigned long ioaddr = 0;
+	struct net_device *dev;
+	struct rtl8169_private *priv;
+	int rc, i;
+	unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
 
-	ret = tp->set_speed(dev, autoneg, speed, duplex);
 
-	if (netif_running(dev) && (tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full))
-		mod_timer(&tp->timer, jiffies + RTL8169_PHY_TIMEOUT);
+	assert (pdev != NULL);
+	assert (ioaddr_out != NULL);
 
-	return ret;
-}
+	*ioaddr_out = 0;
+	*dev_out = NULL;
 
-static int rtl8169_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	unsigned long flags;
-	int ret;
+	// dev zeroed in init_etherdev
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	dev = init_etherdev (NULL, sizeof (*priv));
+#else
+	dev = alloc_etherdev (sizeof (*priv));
+#endif
 
-	spin_lock_irqsave(&tp->lock, flags);
-	ret = rtl8169_set_speed(dev, cmd->autoneg, cmd->speed, cmd->duplex);
-	spin_unlock_irqrestore(&tp->lock, flags);
-	
-	return ret;
-}
+	if (dev == NULL) {
+		printk (KERN_ERR PFX "unable to alloc new ethernet\n");
+		return -ENOMEM;
+	}
 
-static u32 rtl8169_get_rx_csum(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
+	SET_MODULE_OWNER(dev);
 
-	return tp->cp_cmd & RxChkSum;
-}
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
+	SET_NETDEV_DEV(dev, &pdev->dev);
+#endif
 
-static int rtl8169_set_rx_csum(struct net_device *dev, u32 data)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	unsigned long flags;
+	priv = dev->priv;
 
-	spin_lock_irqsave(&tp->lock, flags);
+	// enable device (incl. PCI PM wakeup and hotplug setup)
+	rc = pci_enable_device (pdev);
+	if (rc)
+		goto err_out;
 
-	if (data)
-		tp->cp_cmd |= RxChkSum;
-	else
-		tp->cp_cmd &= ~RxChkSum;
+	mmio_start = pci_resource_start (pdev, 1);
+	mmio_end = pci_resource_end (pdev, 1);
+	mmio_flags = pci_resource_flags (pdev, 1);
+	mmio_len = pci_resource_len (pdev, 1);
+
+	// make sure PCI base addr 1 is MMIO
+	if (!(mmio_flags & IORESOURCE_MEM)) {
+		printk (KERN_ERR PFX "region #1 not an MMIO resource, aborting\n");
+		rc = -ENODEV;
+		goto err_out;
+	}
 
-	RTL_W16(CPlusCmd, tp->cp_cmd);
-	RTL_R16(CPlusCmd);
+	// check for weird/broken PCI region reporting
+	if ( mmio_len < RTL_MIN_IO_SIZE ) {
+		printk (KERN_ERR PFX "Invalid PCI region size(s), aborting\n");
+		rc = -ENODEV;
+		goto err_out;
+	}
 
-	spin_unlock_irqrestore(&tp->lock, flags);
 
-	return 0;
-}
+	rc = pci_request_regions (pdev, dev->name);
+	if (rc)
+		goto err_out;
 
-#ifdef CONFIG_R8169_VLAN
+	// enable PCI bus-mastering
+	pci_set_master (pdev);
 
-static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp,
-				      struct sk_buff *skb)
-{
-	return (tp->vlgrp && vlan_tx_tag_present(skb)) ?
-		TxVlanTag | swab16(vlan_tx_tag_get(skb)) : 0x00;
-}
+#ifdef RTL8169_USE_IO
+	ioaddr = pci_resource_start(pdev, 0);
+#else
+	// ioremap MMIO region
+	ioaddr = (unsigned long)ioremap (mmio_start, mmio_len);
+	if (ioaddr == 0) {
+		printk (KERN_ERR PFX "cannot remap MMIO, aborting\n");
+		rc = -EIO;
+		goto err_out_free_res;
+	}
+#endif
 
-static void rtl8169_vlan_rx_register(struct net_device *dev,
-				     struct vlan_group *grp)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	unsigned long flags;
+	// Soft reset the chip.
+	RTL_W8 ( ChipCmd, CmdReset);
 
-	spin_lock_irqsave(&tp->lock, flags);
-	tp->vlgrp = grp;
-	if (tp->vlgrp)
-		tp->cp_cmd |= RxVlan;
-	else
-		tp->cp_cmd &= ~RxVlan;
-	RTL_W16(CPlusCmd, tp->cp_cmd);
-	RTL_R16(CPlusCmd);
-	spin_unlock_irqrestore(&tp->lock, flags);
-}
+	// Check that the chip has finished the reset.
+	for (i = 1000; i > 0; i--){
+		if ( (RTL_R8(ChipCmd) & CmdReset) == 0){
+			break;
+		}
+		else{
+			udelay (10);
+		}
+	}
 
-static void rtl8169_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	unsigned long flags;
+	// identify config method
+	{
+		unsigned long val32 = (RTL_R32(TxConfig)&0x7c800000);
 
-	spin_lock_irqsave(&tp->lock, flags);
-	if (tp->vlgrp)
-		tp->vlgrp->vlan_devices[vid] = NULL;
-	spin_unlock_irqrestore(&tp->lock, flags);
-}
+		if( val32 == (0x1<<28) ){
+			priv->mcfg = MCFG_METHOD_4;
+		}
+		else if( val32 == (0x1<<26) ){
+			priv->mcfg = MCFG_METHOD_3;
+		}
+		else if( val32 == (0x1<<23) ){
+			priv->mcfg = MCFG_METHOD_2;
+		}
+		else if( val32 == 0x00000000 ){
+			priv->mcfg = MCFG_METHOD_1;
+		}
+		else{
+			priv->mcfg = MCFG_METHOD_1;
+		}
+	}
+	{
+		unsigned char val8 = (unsigned char)(RTL8169_READ_GMII_REG(ioaddr,3)&0x000f);
+		if( val8 == 0x00 ){
+			priv->pcfg = PCFG_METHOD_1;
+		}
+		else if( val8 == 0x01 ){
+			priv->pcfg = PCFG_METHOD_2;
+		}
+		else if( val8 == 0x02 ){
+			priv->pcfg = PCFG_METHOD_3;
+		}
+		else{
+			priv->pcfg = PCFG_METHOD_3;
+		}
+	}
 
-static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,
-			       struct sk_buff *skb)
-{
-	u32 opts2 = le32_to_cpu(desc->opts2);
-	int ret;
 
-	if (tp->vlgrp && (opts2 & RxVlanTag)) {
-		rtl8169_rx_hwaccel_skb(skb, tp->vlgrp,
-				       swab16(opts2 & 0xffff));
-		ret = 0;
-	} else
-		ret = -1;
-	desc->opts2 = 0;
-	return ret;
-}
+	for (i = ARRAY_SIZE (rtl_chip_info) - 1; i >= 0; i--){
+		if (priv->mcfg == rtl_chip_info[i].mcfg) {
+			priv->chipset = i;
+			goto match;
+		}
+	}
 
-#else /* !CONFIG_R8169_VLAN */
+	//if unknown chip, assume array element #0, original RTL-8169 in this case
+	//printk (KERN_DEBUG PFX "PCI device %s: unknown chip version, assuming RTL-8169\n", pdev->slot_name);
+	priv->chipset = 0;
 
-static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp,
-				      struct sk_buff *skb)
-{
+match:
+	*ioaddr_out = ioaddr;
+	*dev_out = dev;
 	return 0;
-}
 
-static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,
-			       struct sk_buff *skb)
-{
-	return -1;
+#ifndef RTL8169_USE_IO
+err_out_free_res:
+	pci_release_regions (pdev);
+#endif
+
+err_out:
+	unregister_netdev (dev);
+	kfree (dev);
+	return rc;
 }
 
-#endif
 
-static void rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	u32 status;
 
-	cmd->supported =
-		SUPPORTED_1000baseT_Full | SUPPORTED_Autoneg | SUPPORTED_FIBRE;
-	cmd->port = PORT_FIBRE;
-	cmd->transceiver = XCVR_INTERNAL;
 
-	status = RTL_R32(TBICSR);
-	cmd->advertising = (status & TBINwEnable) ?  ADVERTISED_Autoneg : 0;
-	cmd->autoneg = !!(status & TBINwEnable);
 
-	cmd->speed = SPEED_1000;
-	cmd->duplex = DUPLEX_FULL; /* Always set */
-}
 
-static void rtl8169_gset_xmii(struct net_device *dev, struct ethtool_cmd *cmd)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	u8 status;
 
-	cmd->supported = SUPPORTED_10baseT_Half |
-			 SUPPORTED_10baseT_Full |
-			 SUPPORTED_100baseT_Half |
-			 SUPPORTED_100baseT_Full |
-			 SUPPORTED_1000baseT_Full |
-			 SUPPORTED_Autoneg |
-		         SUPPORTED_TP;
+//======================================================================================================
+static int __devinit rtl8169_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+{
+	struct net_device *dev = NULL;
+	struct rtl8169_private *priv = NULL;
+	unsigned long ioaddr = 0;
+	static int board_idx = -1;
+	int i;
+	int option = -1, Cap10_100 = 0, Cap1000 = 0;
 
-	cmd->autoneg = 1;
-	cmd->advertising = ADVERTISED_TP | ADVERTISED_Autoneg;
 
-	if (tp->phy_auto_nego_reg & PHY_Cap_10_Half)
-		cmd->advertising |= ADVERTISED_10baseT_Half;
-	if (tp->phy_auto_nego_reg & PHY_Cap_10_Full)
-		cmd->advertising |= ADVERTISED_10baseT_Full;
-	if (tp->phy_auto_nego_reg & PHY_Cap_100_Half)
-		cmd->advertising |= ADVERTISED_100baseT_Half;
-	if (tp->phy_auto_nego_reg & PHY_Cap_100_Full)
-		cmd->advertising |= ADVERTISED_100baseT_Full;
-	if (tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full)
-		cmd->advertising |= ADVERTISED_1000baseT_Full;
+	assert (pdev != NULL);
+	assert (ent != NULL);
 
-	status = RTL_R8(PHYstatus);
+	board_idx++;
 
-	if (status & _1000bpsF)
-		cmd->speed = SPEED_1000;
-	else if (status & _100bps)
-		cmd->speed = SPEED_100;
-	else if (status & _10bps)
-		cmd->speed = SPEED_10;
 
-	cmd->duplex = ((status & _1000bpsF) || (status & FullDup)) ?
-		      DUPLEX_FULL : DUPLEX_HALF;
-}
+	i = rtl8169_init_board (pdev, &dev, &ioaddr);
+	if (i < 0) {
+		return i;
+	}
 
-static int rtl8169_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	unsigned long flags;
+	priv = dev->priv;
 
-	spin_lock_irqsave(&tp->lock, flags);
+	assert (ioaddr != NULL);
+	assert (dev != NULL);
+	assert (priv != NULL);
 
-	tp->get_settings(dev, cmd);
+	// Get MAC address //
+	for (i = 0; i < MAC_ADDR_LEN ; i++){
+		dev->dev_addr[i] = RTL_R8( MAC0 + i );
+	}
 
-	spin_unlock_irqrestore(&tp->lock, flags);
-	return 0;
-}
+	dev->open		= rtl8169_open;
+	dev->hard_start_xmit 	= rtl8169_start_xmit;
+	dev->get_stats    	= rtl8169_get_stats;
+	dev->stop 		= rtl8169_close;
+	dev->tx_timeout 	= rtl8169_tx_timeout;
+	dev->set_multicast_list = rtl8169_set_rx_mode;
+	dev->watchdog_timeo 	= TX_TIMEOUT;
+	dev->irq 		= pdev->irq;
+	dev->base_addr 		= (unsigned long) ioaddr;
+
+#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+	dev->change_mtu		= rtl8169_change_mtu;
+#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+#ifdef RTL8169_IOCTL_SUPPORT
+	dev->do_ioctl 		= rtl8169_ioctl;
+#endif //end #ifdef RTL8169_IOCTL_SUPPORT
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+	priv->rt.dev = dev;
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+	priv = dev->priv;				// private data //
+	priv->pci_dev 	= pdev;
+	priv->ioaddr 	= ioaddr;
+
+//#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+	priv->curr_mtu_size = dev->mtu;
+	priv->tx_pkt_len = dev->mtu + ETH_HDR_LEN;
+	priv->rx_pkt_len = dev->mtu + ETH_HDR_LEN;
+	priv->hw_rx_pkt_len = priv->rx_pkt_len + 8;
+//#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+	DBG_PRINT("-------------------------- \n");
+	DBG_PRINT("dev->mtu = %d \n", dev->mtu);
+	DBG_PRINT("priv->curr_mtu_size = %d \n", priv->curr_mtu_size);
+	DBG_PRINT("priv->tx_pkt_len = %d \n", priv->tx_pkt_len);
+	DBG_PRINT("priv->rx_pkt_len = %d \n", priv->rx_pkt_len);
+	DBG_PRINT("priv->hw_rx_pkt_len = %d \n", priv->hw_rx_pkt_len);
+	DBG_PRINT("-------------------------- \n");
+
+	spin_lock_init (&priv->lock);
+
+	register_netdev (dev);
+
+	pci_set_drvdata(pdev, dev);     //      pdev->driver_data = data;
+
+
+	printk (KERN_DEBUG "%s: Identified chip type is '%s'.\n",dev->name,rtl_chip_info[priv->chipset].name);
+	printk (KERN_INFO "%s: %s at 0x%lx, "
+				"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
+				"IRQ %d\n",
+				dev->name,
+				RTL8169_DRIVER_NAME,
+				dev->base_addr,
+				dev->dev_addr[0], dev->dev_addr[1],
+				dev->dev_addr[2], dev->dev_addr[3],
+				dev->dev_addr[4], dev->dev_addr[5],
+				dev->irq);
 
-static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs,
-			     void *p)
-{
-        struct rtl8169_private *tp = netdev_priv(dev);
-        unsigned long flags;
 
-        if (regs->len > R8169_REGS_SIZE)
-        	regs->len = R8169_REGS_SIZE;
+	// Config PHY
+	rtl8169_hw_PHY_config(dev);
 
-        spin_lock_irqsave(&tp->lock, flags);
-        memcpy_fromio(p, tp->mmio_addr, regs->len);
-        spin_unlock_irqrestore(&tp->lock, flags);
-}
-
-static struct ethtool_ops rtl8169_ethtool_ops = {
-	.get_drvinfo		= rtl8169_get_drvinfo,
-	.get_regs_len		= rtl8169_get_regs_len,
-	.get_link		= ethtool_op_get_link,
-	.get_settings		= rtl8169_get_settings,
-	.set_settings		= rtl8169_set_settings,
-	.get_rx_csum		= rtl8169_get_rx_csum,
-	.set_rx_csum		= rtl8169_set_rx_csum,
-	.get_tx_csum		= ethtool_op_get_tx_csum,
-	.set_tx_csum		= ethtool_op_set_tx_csum,
-	.get_sg			= ethtool_op_get_sg,
-	.set_sg			= ethtool_op_set_sg,
-	.get_tso		= ethtool_op_get_tso,
-	.set_tso		= ethtool_op_set_tso,
-	.get_regs		= rtl8169_get_regs,
-};
+	DBG_PRINT("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
+	RTL_W8( 0x82, 0x01 );
 
-static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg, int bitnum,
-				       int bitval)
-{
-	int val;
+	if( priv->mcfg < MCFG_METHOD_3 ){
+		DBG_PRINT("Set PCI Latency=0x40\n");
+		pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
+	}
 
-	val = mdio_read(ioaddr, reg);
-	val = (bitval == 1) ?
-		val | (bitval << bitnum) :  val & ~(0x0001 << bitnum);
-	mdio_write(ioaddr, reg, val & 0xffff); 
-}
-
-static void rtl8169_get_mac_version(struct rtl8169_private *tp, void __iomem *ioaddr)
-{
-	const struct {
-		u32 mask;
-		int mac_version;
-	} mac_info[] = {
-		{ 0x1 << 28,	RTL_GIGA_MAC_VER_X },
-		{ 0x1 << 26,	RTL_GIGA_MAC_VER_E },
-		{ 0x1 << 23,	RTL_GIGA_MAC_VER_D }, 
-		{ 0x00000000,	RTL_GIGA_MAC_VER_B } /* Catch-all */
-	}, *p = mac_info;
-	u32 reg;
-
-	reg = RTL_R32(TxConfig) & 0x7c800000;
-	while ((reg & p->mask) != p->mask)
-		p++;
-	tp->mac_version = p->mac_version;
-}
-
-static void rtl8169_print_mac_version(struct rtl8169_private *tp)
-{
-	struct {
-		int version;
-		char *msg;
-	} mac_print[] = {
-		{ RTL_GIGA_MAC_VER_E, "RTL_GIGA_MAC_VER_E" },
-		{ RTL_GIGA_MAC_VER_D, "RTL_GIGA_MAC_VER_D" },
-		{ RTL_GIGA_MAC_VER_B, "RTL_GIGA_MAC_VER_B" },
-		{ 0, NULL }
-	}, *p;
-
-	for (p = mac_print; p->msg; p++) {
-		if (tp->mac_version == p->version) {
-			dprintk("mac_version == %s (%04d)\n", p->msg,
-				  p->version);
-			return;
-		}
-	}
-	dprintk("mac_version == Unknown\n");
-}
-
-static void rtl8169_get_phy_version(struct rtl8169_private *tp, void __iomem *ioaddr)
-{
-	const struct {
-		u16 mask;
-		u16 set;
-		int phy_version;
-	} phy_info[] = {
-		{ 0x000f, 0x0002, RTL_GIGA_PHY_VER_G },
-		{ 0x000f, 0x0001, RTL_GIGA_PHY_VER_F },
-		{ 0x000f, 0x0000, RTL_GIGA_PHY_VER_E },
-		{ 0x0000, 0x0000, RTL_GIGA_PHY_VER_D } /* Catch-all */
-	}, *p = phy_info;
-	u16 reg;
-
-	reg = mdio_read(ioaddr, 3) & 0xffff;
-	while ((reg & p->mask) != p->set)
-		p++;
-	tp->phy_version = p->phy_version;
-}
-
-static void rtl8169_print_phy_version(struct rtl8169_private *tp)
-{
-	struct {
-		int version;
-		char *msg;
-		u32 reg;
-	} phy_print[] = {
-		{ RTL_GIGA_PHY_VER_G, "RTL_GIGA_PHY_VER_G", 0x0002 },
-		{ RTL_GIGA_PHY_VER_F, "RTL_GIGA_PHY_VER_F", 0x0001 },
-		{ RTL_GIGA_PHY_VER_E, "RTL_GIGA_PHY_VER_E", 0x0000 },
-		{ RTL_GIGA_PHY_VER_D, "RTL_GIGA_PHY_VER_D", 0x0000 },
-		{ 0, NULL, 0x0000 }
-	}, *p;
-
-	for (p = phy_print; p->msg; p++) {
-		if (tp->phy_version == p->version) {
-			dprintk("phy_version == %s (%04x)\n", p->msg, p->reg);
-			return;
-		}
-	}
-	dprintk("phy_version == Unknown\n");
-}
-
-static void rtl8169_hw_phy_config(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	struct {
-		u16 regs[5]; /* Beware of bit-sign propagation */
-	} phy_magic[5] = { {
-		{ 0x0000,	//w 4 15 12 0
-		  0x00a1,	//w 3 15 0 00a1
-		  0x0008,	//w 2 15 0 0008
-		  0x1020,	//w 1 15 0 1020
-		  0x1000 } },{	//w 0 15 0 1000
-		{ 0x7000,	//w 4 15 12 7
-		  0xff41,	//w 3 15 0 ff41
-		  0xde60,	//w 2 15 0 de60
-		  0x0140,	//w 1 15 0 0140
-		  0x0077 } },{	//w 0 15 0 0077
-		{ 0xa000,	//w 4 15 12 a
-		  0xdf01,	//w 3 15 0 df01
-		  0xdf20,	//w 2 15 0 df20
-		  0xff95,	//w 1 15 0 ff95
-		  0xfa00 } },{	//w 0 15 0 fa00
-		{ 0xb000,	//w 4 15 12 b
-		  0xff41,	//w 3 15 0 ff41
-		  0xde20,	//w 2 15 0 de20
-		  0x0140,	//w 1 15 0 0140
-		  0x00bb } },{	//w 0 15 0 00bb
-		{ 0xf000,	//w 4 15 12 f
-		  0xdf01,	//w 3 15 0 df01
-		  0xdf20,	//w 2 15 0 df20
-		  0xff95,	//w 1 15 0 ff95
-		  0xbf00 }	//w 0 15 0 bf00
+	if( priv->mcfg == MCFG_METHOD_2 ){
+		DBG_PRINT("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
+		RTL_W8( 0x82, 0x01 );
+		DBG_PRINT("Set PHY Reg 0x0bh = 0x00h\n");
+		RTL8169_WRITE_GMII_REG( ioaddr, 0x0b, 0x0000 );	//w 0x0b 15 0 0
+	}
+
+	// if TBI is not endbled
+	if( !(RTL_R8(PHYstatus) & TBI_Enable) ){
+		int	val = RTL8169_READ_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG );
+
+#ifdef RTL8169_HW_FLOW_CONTROL_SUPPORT
+		val |= PHY_Cap_PAUSE | PHY_Cap_ASYM_PAUSE ;
+#endif //end #define RTL8169_HW_FLOW_CONTROL_SUPPORT
+
+		option = (board_idx >= MAX_UNITS) ? 0 : media[board_idx];
+		// Force RTL8169 in 10/100/1000 Full/Half mode.
+		if( option > 0 ){
+			printk(KERN_INFO "%s: Force-mode Enabled. \n", dev->name);
+			Cap10_100 = 0;
+			Cap1000 = 0;
+			switch( option ){
+				case _10_Half:
+						Cap10_100 = PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_Null;
+						break;
+				case _10_Full:
+						Cap10_100 = PHY_Cap_10_Full | PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_Null;
+						break;
+				case _100_Half:
+						Cap10_100 = PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_Null;
+						break;
+				case _100_Full:
+						Cap10_100 = PHY_Cap_100_Full | PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_Null;
+						break;
+				case _1000_Full:
+						Cap10_100 = PHY_Cap_100_Full | PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_1000_Full;
+						break;
+				default:
+						break;
+			}
+			RTL8169_WRITE_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG, Cap10_100 | ( val&0xC1F ) );	//leave PHY_AUTO_NEGO_REG bit4:0 unchanged
+			RTL8169_WRITE_GMII_REG( ioaddr, PHY_1000_CTRL_REG, Cap1000 );
 		}
-	}, *p = phy_magic;
-	int i;
+		else{
+			printk(KERN_INFO "%s: Auto-negotiation Enabled.\n", dev->name);
 
-	rtl8169_print_mac_version(tp);
-	rtl8169_print_phy_version(tp);
+			// enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged
+			RTL8169_WRITE_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG,
+				PHY_Cap_10_Half | PHY_Cap_10_Full | PHY_Cap_100_Half | PHY_Cap_100_Full | ( val&0xC1F ) );
 
-	if (tp->mac_version <= RTL_GIGA_MAC_VER_B)
-		return;
-	if (tp->phy_version >= RTL_GIGA_PHY_VER_H)
-		return;
+			// enable 1000 Full Mode
+			RTL8169_WRITE_GMII_REG( ioaddr, PHY_1000_CTRL_REG, PHY_Cap_1000_Full );
 
-	dprintk("MAC version != 0 && PHY version == 0 or 1\n");
-	dprintk("Do final_reg2.cfg\n");
+		}// end of if( option > 0 )
 
-	/* Shazam ! */
 
-	if (tp->mac_version == RTL_GIGA_MAC_VER_X) {
-		mdio_write(ioaddr, 31, 0x0001);
-		mdio_write(ioaddr,  9, 0x273a);
-		mdio_write(ioaddr, 14, 0x7bfb);
-		mdio_write(ioaddr, 27, 0x841e);
+		// Enable auto-negotiation and restart auto-nigotiation
+		RTL8169_WRITE_GMII_REG( ioaddr, PHY_CTRL_REG, PHY_Enable_Auto_Nego | PHY_Restart_Auto_Nego );
+		udelay(100);
 
-		mdio_write(ioaddr, 31, 0x0002);
-		mdio_write(ioaddr,  1, 0x90d0);
-		mdio_write(ioaddr, 31, 0x0000);
-		return;
-	}
+		// wait for auto-negotiation process
+		for( i = 10000; i > 0; i-- ){
+			//check if auto-negotiation complete
+			if( RTL8169_READ_GMII_REG(ioaddr, PHY_STAT_REG) & PHY_Auto_Neco_Comp ){
+				udelay(100);
+				option = RTL_R8(PHYstatus);
+				if( option & _1000bpsF ){
+					printk(KERN_INFO "%s: 1000Mbps Full-duplex operation.\n", dev->name);
+				}
+				else{
+					printk(KERN_INFO "%s: %sMbps %s-duplex operation.\n", dev->name,
+							(option & _100bps) ? "100" : "10", (option & FullDup) ? "Full" : "Half" );
+				}
+				break;
+			}
+			else{
+				udelay(100);
+			}// end of if( RTL8169_READ_GMII_REG(ioaddr, 1) & 0x20 )
+		}// end for-loop to wait for auto-negotiation process
+
+		option = RTL_R8(PHYstatus);
+		if( option & _1000bpsF ){
+			priv->linkstatus = _1000_Full;
+		}
+		else{
+			if(option & _100bps){
+				priv->linkstatus = (option & FullDup) ? _100_Full : _100_Half;
+			}
+            else{
+				priv->linkstatus = (option & FullDup) ? _10_Full : _10_Half;
+			}
+		}
+		DBG_PRINT("priv->linkstatus = 0x%02x\n", priv->linkstatus);
 
-	/* phy config for RTL8169s mac_version C chip */
-	mdio_write(ioaddr, 31, 0x0001);			//w 31 2 0 1
-	mdio_write(ioaddr, 21, 0x1000);			//w 21 15 0 1000
-	mdio_write(ioaddr, 24, 0x65c7);			//w 24 15 0 65c7
-	rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0);	//w 4 11 11 0
+	}// end of TBI is not enabled
+	else{
+		udelay(100);
+		DBG_PRINT("1000Mbps Full-duplex operation, TBI Link %s!\n",(RTL_R32(TBICSR) & TBILinkOK) ? "OK" : "Failed" );
 
-	for (i = 0; i < ARRAY_SIZE(phy_magic); i++, p++) {
-		int val, pos = 4;
+	}// end of TBI is not enabled
 
-		val = (mdio_read(ioaddr, pos) & 0x0fff) | (p->regs[0] & 0xffff);
-		mdio_write(ioaddr, pos, val);
-		while (--pos >= 0)
-			mdio_write(ioaddr, pos, p->regs[4 - pos] & 0xffff);
-		rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 1); //w 4 11 11 1
-		rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0
-	}
-	mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0
+	return 0;
 }
 
-static void rtl8169_phy_timer(unsigned long __opaque)
-{
-	struct net_device *dev = (struct net_device *)__opaque;
-	struct rtl8169_private *tp = netdev_priv(dev);
-	struct timer_list *timer = &tp->timer;
-	void __iomem *ioaddr = tp->mmio_addr;
-	unsigned long timeout = RTL8169_PHY_TIMEOUT;
 
-	assert(tp->mac_version > RTL_GIGA_MAC_VER_B);
-	assert(tp->phy_version < RTL_GIGA_PHY_VER_H);
 
-	if (!(tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full))
-		return;
 
-	spin_lock_irq(&tp->lock);
 
-	if (tp->phy_reset_pending(ioaddr)) {
-		/* 
-		 * A busy loop could burn quite a few cycles on nowadays CPU.
-		 * Let's delay the execution of the timer for a few ticks.
-		 */
-		timeout = HZ/10;
-		goto out_mod_timer;
-	}
 
-	if (tp->link_ok(ioaddr))
-		goto out_unlock;
 
-	printk(KERN_WARNING PFX "%s: PHY reset until link up\n", dev->name);
+//======================================================================================================
+static void __devexit rtl8169_remove_one (struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata(pdev);
 
-	tp->phy_reset_enable(ioaddr);
+	assert (dev != NULL);
+	assert (priv != NULL);
 
-out_mod_timer:
-	mod_timer(timer, jiffies + timeout);
-out_unlock:
-	spin_unlock_irq(&tp->lock);
-}
+	unregister_netdev (dev);
 
-static inline void rtl8169_delete_timer(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	struct timer_list *timer = &tp->timer;
+#ifdef RTL8169_USE_IO
+#else
+	iounmap ((void *)(dev->base_addr));
+#endif
+	pci_release_regions (pdev);
 
-	if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) ||
-	    (tp->phy_version >= RTL_GIGA_PHY_VER_H))
-		return;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	kfree (dev);
+#else
+	free_netdev(dev);
+#endif
 
-	del_timer_sync(timer);
+	pci_set_drvdata (pdev, NULL);
 }
 
-static inline void rtl8169_request_timer(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	struct timer_list *timer = &tp->timer;
 
-	if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) ||
-	    (tp->phy_version >= RTL_GIGA_PHY_VER_H))
-		return;
 
-	init_timer(timer);
-	timer->expires = jiffies + RTL8169_PHY_TIMEOUT;
-	timer->data = (unsigned long)(dev);
-	timer->function = rtl8169_phy_timer;
-	add_timer(timer);
-}
 
-#ifdef CONFIG_NET_POLL_CONTROLLER
-/*
- * Polling 'interrupt' - used by things like netconsole to send skbs
- * without having to re-enable interrupts. It's not called while
- * the interrupt routine is executing.
- */
-static void rtl8169_netpoll(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	struct pci_dev *pdev = tp->pci_dev;
-
-	disable_irq(pdev->irq);
-	rtl8169_interrupt(pdev->irq, dev, NULL);
-	enable_irq(pdev->irq);
-}
-#endif
 
-static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev,
-				  void __iomem *ioaddr)
-{
-	iounmap(ioaddr);
-	pci_release_regions(pdev);
-	pci_disable_device(pdev);
-	free_netdev(dev);
-}
 
-static int __devinit
-rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
-		   void __iomem **ioaddr_out)
+
+//======================================================================================================
+static int rtl8169_open (struct net_device *dev)
 {
-	void __iomem *ioaddr;
-	struct net_device *dev;
-	struct rtl8169_private *tp;
-	int rc = -ENOMEM, i, acpi_idle_state = 0, pm_cap;
+	struct rtl8169_private *priv = dev->priv;
+	struct pci_dev *pdev = priv->pci_dev;
+	int retval;
+//	u8 diff;
+//	u32 TxPhyAddr, RxPhyAddr;
 
-	assert(ioaddr_out != NULL);
 
-	/* dev zeroed in alloc_etherdev */
-	dev = alloc_etherdev(sizeof (*tp));
-	if (dev == NULL) {
-		printk(KERN_ERR PFX "unable to alloc new ethernet\n");
-		goto err_out;
+	if( priv->drvinit_fail == 1 ){
+		printk("%s: Gigabit driver open failed.\n", dev->name );
+		return -ENOMEM;
 	}
 
-	SET_MODULE_OWNER(dev);
-	SET_NETDEV_DEV(dev, &pdev->dev);
-	tp = netdev_priv(dev);
-
-	/* enable device (incl. PCI PM wakeup and hotplug setup) */
-	rc = pci_enable_device(pdev);
-	if (rc) {
-		printk(KERN_ERR PFX "%s: enable failure\n", pci_name(pdev));
-		goto err_out_free_dev;
-	}
-
-	rc = pci_set_mwi(pdev);
-	if (rc < 0)
-		goto err_out_disable;
-
-	/* save power state before pci_enable_device overwrites it */
-	pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
-	if (pm_cap) {
-		u16 pwr_command;
-
-		pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);
-		acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
-	} else {
-		printk(KERN_ERR PFX
-		       "Cannot find PowerManagement capability, aborting.\n");
-		goto err_out_mwi;
+	retval = request_irq (dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev);
+	if (retval) {
+		return retval;
 	}
 
-	/* make sure PCI base addr 1 is MMIO */
-	if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
-		printk(KERN_ERR PFX
-		       "region #1 not an MMIO resource, aborting\n");
-		rc = -ENODEV;
-		goto err_out_mwi;
+	//2004-05-11
+	// Allocate tx/rx descriptor space
+	priv->sizeof_txdesc_space = NUM_TX_DESC * sizeof(struct TxDesc)+256;
+	priv->txdesc_space = pci_alloc_consistent( pdev, priv->sizeof_txdesc_space, &priv->txdesc_phy_dma_addr );
+	if( priv->txdesc_space == NULL ){
+		printk("%s: Gigabit driver alloc txdesc_space failed.\n", dev->name );
+		return -ENOMEM;
 	}
-	/* check for weird/broken PCI region reporting */
-	if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
-		printk(KERN_ERR PFX "Invalid PCI region size(s), aborting\n");
-		rc = -ENODEV;
-		goto err_out_mwi;
+	priv->sizeof_rxdesc_space = NUM_RX_DESC * sizeof(struct RxDesc)+256;
+	priv->rxdesc_space = pci_alloc_consistent( pdev, priv->sizeof_rxdesc_space, &priv->rxdesc_phy_dma_addr );
+	if( priv->rxdesc_space == NULL ){
+		printk("%s: Gigabit driver alloc rxdesc_space failed.\n", dev->name );
+		return -ENOMEM;
 	}
 
-	rc = pci_request_regions(pdev, MODULENAME);
-	if (rc) {
-		printk(KERN_ERR PFX "%s: could not request regions.\n",
-		       pci_name(pdev));
-		goto err_out_mwi;
+	if(priv->txdesc_phy_dma_addr & 0xff){
+		printk("%s: Gigabit driver txdesc_phy_dma_addr is not 256-bytes-aligned.\n", dev->name );
 	}
+	if(priv->rxdesc_phy_dma_addr & 0xff){
+		printk("%s: Gigabit driver rxdesc_phy_dma_addr is not 256-bytes-aligned.\n", dev->name );
+	}
+	// Set tx/rx descriptor space
+	priv->TxDescArray = (struct TxDesc *)priv->txdesc_space;
+	priv->RxDescArray = (struct RxDesc *)priv->rxdesc_space;
 
-	tp->cp_cmd = PCIMulRW | RxChkSum;
+	{
+		int i;
+		struct sk_buff *skb = NULL;
 
-	if ((sizeof(dma_addr_t) > 4) &&
-	    !pci_set_dma_mask(pdev, DMA_64BIT_MASK) && use_dac) {
-		tp->cp_cmd |= PCIDAC;
-		dev->features |= NETIF_F_HIGHDMA;
-	} else {
-		rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
-		if (rc < 0) {
-			printk(KERN_ERR PFX "DMA configuration failed.\n");
-			goto err_out_free_res;
+		for(i=0;i<NUM_RX_DESC;i++){
+			skb = RTL8169_ALLOC_RXSKB(MAX_RX_SKBDATA_SIZE);
+			if( skb != NULL ) {
+				skb_reserve (skb, 2);	// 16 byte align the IP fields. //
+				priv->Rx_skbuff[i] = skb;
+			}
+			else{
+				printk("%s: Gigabit driver failed to allocate skbuff.\n", dev->name);
+				priv->drvinit_fail = 1;
+			}
 		}
 	}
 
-	pci_set_master(pdev);
 
-	/* ioremap MMIO region */
-	ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
-	if (ioaddr == NULL) {
-		printk(KERN_ERR PFX "cannot remap MMIO, aborting\n");
-		rc = -EIO;
-		goto err_out_free_res;
-	}
+	//////////////////////////////////////////////////////////////////////////////
+	rtl8169_init_ring (dev);
+	rtl8169_hw_start (dev);
 
-	/* Unneeded ? Don't mess with Mrs. Murphy. */
-	rtl8169_irq_mask_and_ack(ioaddr);
 
-	/* Soft reset the chip. */
-	RTL_W8(ChipCmd, CmdReset);
+	// ------------------------------------------------------
+	DBG_PRINT("FIX PCS -> rtl8169_request_timer\n");
+	priv->expire_time = RTL8169_TIMER_EXPIRE_TIME;
+	rtl8169_request_timer( (&priv->r8169_timer), priv->expire_time, rtl8169_timer_handler, ((void *)dev) );  //in open()
 
-	/* Check that the chip has finished the reset. */
-	for (i = 1000; i > 0; i--) {
-		if ((RTL_R8(ChipCmd) & CmdReset) == 0)
-			break;
-		udelay(10);
-	}
 
-	/* Identify chip attached to board */
-	rtl8169_get_mac_version(tp, ioaddr);
-	rtl8169_get_phy_version(tp, ioaddr);
+	DBG_PRINT("%s: %s() alloc_rxskb_cnt = %d\n", dev->name, __FUNCTION__, alloc_rxskb_cnt );
 
-	rtl8169_print_mac_version(tp);
-	rtl8169_print_phy_version(tp);
+	return 0;
 
-	for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) {
-		if (tp->mac_version == rtl_chip_info[i].mac_version)
-			break;
-	}
-	if (i < 0) {
-		/* Unknown chip: assume array element #0, original RTL-8169 */
-		printk(KERN_DEBUG PFX
-		       "PCI device %s: unknown chip version, assuming %s\n",
-		       pci_name(pdev), rtl_chip_info[0].name);
-		i++;
-	}
-	tp->chipset = i;
+}//end of rtl8169_open (struct net_device *dev)
 
-	*ioaddr_out = ioaddr;
-	*dev_out = dev;
-out:
-	return rc;
 
-err_out_free_res:
-	pci_release_regions(pdev);
 
-err_out_mwi:
-	pci_clear_mwi(pdev);
 
-err_out_disable:
-	pci_disable_device(pdev);
 
-err_out_free_dev:
-	free_netdev(dev);
-err_out:
-	*ioaddr_out = NULL;
-	*dev_out = NULL;
-	goto out;
-}
-
-static int __devinit
-rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
-{
-	struct net_device *dev = NULL;
-	struct rtl8169_private *tp;
-	void __iomem *ioaddr = NULL;
-	static int board_idx = -1;
-	static int printed_version = 0;
-	u8 autoneg, duplex;
-	u16 speed;
-	int i, rc;
 
-	assert(pdev != NULL);
-	assert(ent != NULL);
 
-	board_idx++;
 
-	if (!printed_version) {
-		printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n",
-		       MODULENAME, RTL8169_VERSION);
-		printed_version = 1;
-	}
-
-	rc = rtl8169_init_board(pdev, &dev, &ioaddr);
-	if (rc)
-		return rc;
-
-	tp = netdev_priv(dev);
-	assert(ioaddr != NULL);
-
-	if (RTL_R8(PHYstatus) & TBI_Enable) {
-		tp->set_speed = rtl8169_set_speed_tbi;
-		tp->get_settings = rtl8169_gset_tbi;
-		tp->phy_reset_enable = rtl8169_tbi_reset_enable;
-		tp->phy_reset_pending = rtl8169_tbi_reset_pending;
-		tp->link_ok = rtl8169_tbi_link_ok;
-
-		tp->phy_1000_ctrl_reg = PHY_Cap_1000_Full; /* Implied by TBI */
-	} else {
-		tp->set_speed = rtl8169_set_speed_xmii;
-		tp->get_settings = rtl8169_gset_xmii;
-		tp->phy_reset_enable = rtl8169_xmii_reset_enable;
-		tp->phy_reset_pending = rtl8169_xmii_reset_pending;
-		tp->link_ok = rtl8169_xmii_link_ok;
-	}
-
-	/* Get MAC address.  FIXME: read EEPROM */
-	for (i = 0; i < MAC_ADDR_LEN; i++)
-		dev->dev_addr[i] = RTL_R8(MAC0 + i);
-
-	dev->open = rtl8169_open;
-	dev->hard_start_xmit = rtl8169_start_xmit;
-	dev->get_stats = rtl8169_get_stats;
-	SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops);
-	dev->stop = rtl8169_close;
-	dev->tx_timeout = rtl8169_tx_timeout;
-	dev->set_multicast_list = rtl8169_set_rx_mode;
-	dev->watchdog_timeo = RTL8169_TX_TIMEOUT;
-	dev->irq = pdev->irq;
-	dev->base_addr = (unsigned long) ioaddr;
-	dev->change_mtu = rtl8169_change_mtu;
-
-#ifdef CONFIG_R8169_NAPI
-	dev->poll = rtl8169_poll;
-	dev->weight = R8169_NAPI_WEIGHT;
-	printk(KERN_INFO PFX "NAPI enabled\n");
-#endif
+//======================================================================================================
+static void rtl8169_hw_PHY_reset(struct net_device *dev)
+{
+	int val, phy_reset_expiretime = 50;
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
 
-#ifdef CONFIG_R8169_VLAN
-	dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-	dev->vlan_rx_register = rtl8169_vlan_rx_register;
-	dev->vlan_rx_kill_vid = rtl8169_vlan_rx_kill_vid;
-#endif
+	DBG_PRINT("%s: Reset RTL8169s PHY\n", dev->name);
 
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	dev->poll_controller = rtl8169_netpoll;
-#endif
+	val = ( RTL8169_READ_GMII_REG( ioaddr, 0 ) | 0x8000 ) & 0xffff;
+	RTL8169_WRITE_GMII_REG( ioaddr, 0, val );
 
-	tp->intr_mask = 0xffff;
-	tp->pci_dev = pdev;
-	tp->mmio_addr = ioaddr;
+	do //waiting for phy reset
+	{
+		if( RTL8169_READ_GMII_REG( ioaddr, 0 ) & 0x8000 ){
+			phy_reset_expiretime --;
+			udelay(100);
+		}
+		else{
+			break;
+		}
+	}while( phy_reset_expiretime >= 0 );
 
-	spin_lock_init(&tp->lock);
+	assert( phy_reset_expiretime > 0 );
+}
 
-	rc = register_netdev(dev);
-	if (rc) {
-		rtl8169_release_board(pdev, dev, ioaddr);
-		return rc;
-	}
 
-	printk(KERN_DEBUG "%s: Identified chip type is '%s'.\n", dev->name,
-	       rtl_chip_info[tp->chipset].name);
 
-	pci_set_drvdata(pdev, dev);
 
-	printk(KERN_INFO "%s: %s at 0x%lx, "
-	       "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
-	       "IRQ %d\n",
-	       dev->name,
-	       rtl_chip_info[ent->driver_data].name,
-	       dev->base_addr,
-	       dev->dev_addr[0], dev->dev_addr[1],
-	       dev->dev_addr[2], dev->dev_addr[3],
-	       dev->dev_addr[4], dev->dev_addr[5], dev->irq);
+//======================================================================================================
+static void rtl8169_hw_PHY_config (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	void *ioaddr = (void*)priv->ioaddr;
 
-	rtl8169_hw_phy_config(dev);
+	DBG_PRINT("priv->mcfg=%d, priv->pcfg=%d\n",priv->mcfg,priv->pcfg);
 
-	dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
-	RTL_W8(0x82, 0x01);
+	if( priv->mcfg == MCFG_METHOD_4 ){
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0001 );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x09, 0x273a );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x0e, 0x7bfb );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1b, 0x841e );
 
-	if (tp->mac_version < RTL_GIGA_MAC_VER_E) {
-		dprintk("Set PCI Latency=0x40\n");
-		pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0002 );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x01, 0x90D0 );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0000 );
 	}
-
-	if (tp->mac_version == RTL_GIGA_MAC_VER_D) {
-		dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
-		RTL_W8(0x82, 0x01);
-		dprintk("Set PHY Reg 0x0bh = 0x00h\n");
-		mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0
+	else{
+		DBG_PRINT("priv->mcfg=%d. Discard hw PHY config.\n",priv->mcfg);
 	}
-
-	rtl8169_link_option(board_idx, &autoneg, &speed, &duplex);
-
-	rtl8169_set_speed(dev, autoneg, speed, duplex);
-	
-	if (RTL_R8(PHYstatus) & TBI_Enable)
-		printk(KERN_INFO PFX "%s: TBI auto-negotiating\n", dev->name);
-
-	return 0;
 }
 
-static void __devexit
-rtl8169_remove_one(struct pci_dev *pdev)
-{
-	struct net_device *dev = pci_get_drvdata(pdev);
-	struct rtl8169_private *tp = netdev_priv(dev);
 
-	assert(dev != NULL);
-	assert(tp != NULL);
 
-	unregister_netdev(dev);
-	rtl8169_release_board(pdev, dev, tp->mmio_addr);
-	pci_set_drvdata(pdev, NULL);
-}
 
-#ifdef CONFIG_PM
 
-static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state)
-{
-	struct net_device *dev = pci_get_drvdata(pdev);
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	unsigned long flags;
 
-	if (!netif_running(dev))
-		return 0;
-	
-	netif_device_detach(dev);
-	netif_stop_queue(dev);
-	spin_lock_irqsave(&tp->lock, flags);
-
-	/* Disable interrupts, stop Rx and Tx */
-	RTL_W16(IntrMask, 0);
-	RTL_W8(ChipCmd, 0);
-		
-	/* Update the error counts. */
-	tp->stats.rx_missed_errors += RTL_R32(RxMissed);
-	RTL_W32(RxMissed, 0);
-	spin_unlock_irqrestore(&tp->lock, flags);
-	
-	return 0;
-}
 
-static int rtl8169_resume(struct pci_dev *pdev)
-{
-	struct net_device *dev = pci_get_drvdata(pdev);
 
-	if (!netif_running(dev))
-	    return 0;
 
-	netif_device_attach(dev);
-	rtl8169_hw_start(dev);
 
-	return 0;
-}
-                                                                                
-#endif /* CONFIG_PM */
-
-static void rtl8169_set_rxbufsize(struct rtl8169_private *tp,
-				  struct net_device *dev)
+//======================================================================================================
+static void rtl8169_hw_start (struct net_device *dev)
 {
-	unsigned int mtu = dev->mtu;
-
-	tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE;
-}
-
-static int rtl8169_open(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	struct pci_dev *pdev = tp->pci_dev;
-	int retval;
-
-	rtl8169_set_rxbufsize(tp, dev);
-
-	retval =
-	    request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev);
-	if (retval < 0)
-		goto out;
-
-	retval = -ENOMEM;
-
-	/*
-	 * Rx and Tx desscriptors needs 256 bytes alignment.
-	 * pci_alloc_consistent provides more.
-	 */
-	tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES,
-					       &tp->TxPhyAddr);
-	if (!tp->TxDescArray)
-		goto err_free_irq;
-
-	tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES,
-					       &tp->RxPhyAddr);
-	if (!tp->RxDescArray)
-		goto err_free_tx;
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	u32 i;
 
-	retval = rtl8169_init_ring(dev);
-	if (retval < 0)
-		goto err_free_rx;
 
-	INIT_WORK(&tp->task, NULL, dev);
+	/* Soft reset the chip. */
+	RTL_W8 ( ChipCmd, CmdReset);
 
-	rtl8169_hw_start(dev);
+	/* Check that the chip has finished the reset. */
+	for (i = 1000; i > 0; i--){
+		if ((RTL_R8( ChipCmd ) & CmdReset) == 0) break;
+		else udelay (10);
+	}
 
-	rtl8169_request_timer(dev);
+	RTL_W8 ( Cfg9346, Cfg9346_Unlock);
+	RTL_W8 ( ChipCmd, CmdTxEnb | CmdRxEnb);
+	RTL_W8 ( ETThReg, ETTh);
 
-	rtl8169_check_link_status(dev, tp, tp->mmio_addr);
-out:
-	return retval;
+	// For gigabit rtl8169
+	RTL_W16	( RxMaxSize, (unsigned short)priv->hw_rx_pkt_len );
 
-err_free_rx:
-	pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray,
-			    tp->RxPhyAddr);
-err_free_tx:
-	pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray,
-			    tp->TxPhyAddr);
-err_free_irq:
-	free_irq(dev->irq, dev);
-	goto out;
-}
+	// Set Rx Config register
+	i = rtl8169_rx_config | ( RTL_R32( RxConfig ) & rtl_chip_info[priv->chipset].RxConfigMask);
+	RTL_W32 ( RxConfig, i);
 
-static void rtl8169_hw_reset(void __iomem *ioaddr)
-{
-	/* Disable interrupts */
-	rtl8169_irq_mask_and_ack(ioaddr);
 
-	/* Reset the chipset */
-	RTL_W8(ChipCmd, CmdReset);
+	/* Set DMA burst size and Interframe Gap Time */
+	RTL_W32 ( TxConfig, (TX_DMA_BURST << TxDMAShift) | (InterFrameGap << TxInterFrameGapShift) );
 
-	/* PCI commit */
-	RTL_R8(ChipCmd);
-}
 
-static void
-rtl8169_hw_start(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	u32 i;
 
-	/* Soft reset the chip. */
-	RTL_W8(ChipCmd, CmdReset);
+	RTL_W16( CPlusCmd, RTL_R16(CPlusCmd) );
 
-	/* Check that the chip has finished the reset. */
-	for (i = 1000; i > 0; i--) {
-		if ((RTL_R8(ChipCmd) & CmdReset) == 0)
-			break;
-		udelay(10);
+	if(	priv->mcfg == MCFG_METHOD_2 ||
+		priv->mcfg == MCFG_METHOD_3)
+	{
+		RTL_W16( CPlusCmd, (RTL_R16(CPlusCmd)|(1<<14)|(1<<3)) );
+		DBG_PRINT("Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14\n");
+	}
+	else
+	{
+		RTL_W16( CPlusCmd, (RTL_R16(CPlusCmd)|(1<<3)) );
+		DBG_PRINT("Set MAC Reg C+CR Offset 0xE0: bit-3.\n");
 	}
 
-	RTL_W8(Cfg9346, Cfg9346_Unlock);
-	RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
-	RTL_W8(EarlyTxThres, EarlyTxThld);
-
-	/* Low hurts. Let's disable the filtering. */
-	RTL_W16(RxMaxSize, 16383);
-
-	/* Set Rx Config register */
-	i = rtl8169_rx_config |
-		(RTL_R32(RxConfig) & rtl_chip_info[tp->chipset].RxConfigMask);
-	RTL_W32(RxConfig, i);
+	{
+		//RTL_W16(0xE2, 0x1517);
+		//RTL_W16(0xE2, 0x152a);
+		//RTL_W16(0xE2, 0x282a);
+		RTL_W16(0xE2, 0x0000);
+	}
 
-	/* Set DMA burst size and Interframe Gap Time */
-	RTL_W32(TxConfig,
-		(TX_DMA_BURST << TxDMAShift) | (InterFrameGap <<
-						TxInterFrameGapShift));
-	tp->cp_cmd |= RTL_R16(CPlusCmd);
-	RTL_W16(CPlusCmd, tp->cp_cmd);
-
-	if ((tp->mac_version == RTL_GIGA_MAC_VER_D) ||
-	    (tp->mac_version == RTL_GIGA_MAC_VER_E)) {
-		dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0. "
-			"Bit-3 and bit-14 MUST be 1\n");
-		tp->cp_cmd |= (1 << 14) | PCIMulRW;
-		RTL_W16(CPlusCmd, tp->cp_cmd);
-	}
-
-	/*
-	 * Undocumented corner. Supposedly:
-	 * (TxTimer << 12) | (TxPackets << 8) | (RxTimer << 4) | RxPackets
-	 */
-	RTL_W16(IntrMitigate, 0x0000);
-
-	RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK));
-	RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32));
-	RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK));
-	RTL_W32(RxDescAddrHigh, ((u64) tp->RxPhyAddr >> 32));
-	RTL_W8(Cfg9346, Cfg9346_Lock);
-	udelay(10);
-
-	RTL_W32(RxMissed, 0);
-
-	rtl8169_set_rx_mode(dev);
+	priv->cur_rx = 0;
 
-	/* no early-rx interrupts */
-	RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xF000);
+	RTL_W32 ( TxDescStartAddr, priv->txdesc_phy_dma_addr);
+	RTL_W32 ( TxDescStartAddr + 4, 0x00);
+	RTL_W32 ( RxDescStartAddr, priv->rxdesc_phy_dma_addr);
+	RTL_W32 ( RxDescStartAddr + 4, 0x00);
 
-	/* Enable all known interrupts by setting the interrupt mask. */
-	RTL_W16(IntrMask, rtl8169_intr_mask);
+	RTL_W8 ( Cfg9346, Cfg9346_Lock );
+	udelay (10);
 
-	netif_start_queue(dev);
-}
+	RTL_W32 ( RxMissed, 0 );
 
-static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	int ret = 0;
+	rtl8169_set_rx_mode (dev);
 
-	if (new_mtu < ETH_ZLEN || new_mtu > SafeMtu)
-		return -EINVAL;
+	RTL_W16 ( MultiIntr, RTL_R16(MultiIntr) & 0xF000);
 
-	dev->mtu = new_mtu;
+	RTL_W16 ( IntrMask, rtl8169_intr_mask);
 
-	if (!netif_running(dev))
-		goto out;
+	netif_start_queue (dev);
 
-	rtl8169_down(dev);
+}//end of rtl8169_hw_start (struct net_device *dev)
 
-	rtl8169_set_rxbufsize(tp, dev);
 
-	ret = rtl8169_init_ring(dev);
-	if (ret < 0)
-		goto out;
 
-	netif_poll_enable(dev);
 
-	rtl8169_hw_start(dev);
 
-	rtl8169_request_timer(dev);
 
-out:
-	return ret;
-}
 
-static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
+//======================================================================================================
+static void rtl8169_init_ring (struct net_device *dev)
 {
-	desc->addr = 0x0badbadbadbadbadull;
-	desc->opts1 &= ~cpu_to_le32(DescOwn | RsvdMask);
-}
+	struct rtl8169_private *priv = dev->priv;
+	struct pci_dev *pdev = priv->pci_dev;
+	int i;
+	struct sk_buff	*skb;
+	
 
-static void rtl8169_free_rx_skb(struct rtl8169_private *tp,
-				struct sk_buff **sk_buff, struct RxDesc *desc)
-{
-	struct pci_dev *pdev = tp->pci_dev;
+	priv->cur_rx = 0;
+	priv->cur_tx = 0;
+	priv->dirty_tx = 0;
+	memset(priv->TxDescArray, 0x0, NUM_TX_DESC*sizeof(struct TxDesc));
+	memset(priv->RxDescArray, 0x0, NUM_RX_DESC*sizeof(struct RxDesc));
 
-	pci_unmap_single(pdev, le64_to_cpu(desc->addr), tp->rx_buf_sz,
-			 PCI_DMA_FROMDEVICE);
-	dev_kfree_skb(*sk_buff);
-	*sk_buff = NULL;
-	rtl8169_make_unusable_by_asic(desc);
-}
 
-static inline void rtl8169_mark_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
-{
-	u32 eor = le32_to_cpu(desc->opts1) & RingEnd;
+	for (i=0 ; i<NUM_TX_DESC ; i++){
+		priv->Tx_skbuff[i]=NULL;
+		priv->txdesc_array_dma_addr[i] = pci_map_single(pdev, &priv->TxDescArray[i], sizeof(struct TxDesc), PCI_DMA_TODEVICE);
+	}
 
-	desc->opts1 = cpu_to_le32(DescOwn | eor | rx_buf_sz);
-}
+	for (i=0; i <NUM_RX_DESC; i++) {
+		if(i==(NUM_RX_DESC-1)){
+			priv->RxDescArray[i].status = cpu_to_le32((OWNbit | EORbit) | (unsigned long)priv->hw_rx_pkt_len);
+		}
+		else{
+			priv->RxDescArray[i].status = cpu_to_le32(OWNbit | (unsigned long)priv->hw_rx_pkt_len);
+		}
 
-static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
-				       u32 rx_buf_sz)
-{
-	desc->addr = cpu_to_le64(mapping);
-	wmb();
-	rtl8169_mark_to_asic(desc, rx_buf_sz);
+		{//-----------------------------------------------------------------------
+			skb = priv->Rx_skbuff[i];
+			priv->rx_skbuff_dma_addr[i] = pci_map_single(pdev, skb->data, MAX_RX_SKBDATA_SIZE, PCI_DMA_FROMDEVICE);
+
+			if( skb != NULL ){
+				priv->RxDescArray[i].buf_addr = cpu_to_le32(priv->rx_skbuff_dma_addr[i]);
+				priv->RxDescArray[i].buf_Haddr = 0;
+			}
+			else{
+				DBG_PRINT("%s: %s() Rx_skbuff == NULL\n", dev->name, __FUNCTION__);
+				priv->drvinit_fail = 1;
+			}
+		}//-----------------------------------------------------------------------
+		priv->rxdesc_array_dma_addr[i] = pci_map_single(pdev, &priv->RxDescArray[i], sizeof(struct RxDesc), PCI_DMA_TODEVICE);
+		pci_dma_sync_single_for_device(pdev, priv->rxdesc_array_dma_addr[i], sizeof(struct RxDesc), PCI_DMA_TODEVICE);
+	}
 }
 
-static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
-				struct RxDesc *desc, int rx_buf_sz)
-{
-	struct sk_buff *skb;
-	dma_addr_t mapping;
-	int ret = 0;
 
-	skb = dev_alloc_skb(rx_buf_sz + NET_IP_ALIGN);
-	if (!skb)
-		goto err_out;
 
-	skb_reserve(skb, NET_IP_ALIGN);
-	*sk_buff = skb;
 
-	mapping = pci_map_single(pdev, skb->tail, rx_buf_sz,
-				 PCI_DMA_FROMDEVICE);
 
-	rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
 
-out:
-	return ret;
 
-err_out:
-	ret = -ENOMEM;
-	rtl8169_make_unusable_by_asic(desc);
-	goto out;
-}
-
-static void rtl8169_rx_clear(struct rtl8169_private *tp)
+//======================================================================================================
+static void rtl8169_tx_clear (struct rtl8169_private *priv)
 {
 	int i;
 
-	for (i = 0; i < NUM_RX_DESC; i++) {
-		if (tp->Rx_skbuff[i]) {
-			rtl8169_free_rx_skb(tp, tp->Rx_skbuff + i,
-					    tp->RxDescArray + i);
+	priv->cur_tx = 0;
+	for ( i = 0 ; i < NUM_TX_DESC ; i++ ){
+		if ( priv->Tx_skbuff[i] != NULL ) {
+			dev_kfree_skb ( priv->Tx_skbuff[i] );
+			priv->Tx_skbuff[i] = NULL;
+			priv->stats.tx_dropped++;
 		}
 	}
 }
 
-static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
-			   u32 start, u32 end)
-{
-	u32 cur;
-	
-	for (cur = start; end - cur > 0; cur++) {
-		int ret, i = cur % NUM_RX_DESC;
 
-		if (tp->Rx_skbuff[i])
-			continue;
-			
-		ret = rtl8169_alloc_rx_skb(tp->pci_dev, tp->Rx_skbuff + i,
-					   tp->RxDescArray + i, tp->rx_buf_sz);
-		if (ret < 0)
-			break;
-	}
-	return cur - start;
-}
 
-static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc)
-{
-	desc->opts1 |= cpu_to_le32(RingEnd);
-}
 
-static void rtl8169_init_ring_indexes(struct rtl8169_private *tp)
-{
-	tp->dirty_tx = tp->dirty_rx = tp->cur_tx = tp->cur_rx = 0;
-}
 
-static int rtl8169_init_ring(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
 
-	rtl8169_init_ring_indexes(tp);
 
-	memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info));
-	memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *));
+//======================================================================================================
+static void rtl8169_tx_timeout (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	u8 tmp8;
 
-	if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC)
-		goto err_out;
+	/* disable Tx, if not already */
+	tmp8 = RTL_R8( ChipCmd );
+	if (tmp8 & CmdTxEnb){
+		RTL_W8 ( ChipCmd, tmp8 & ~CmdTxEnb);
+	}
 
-	rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
+	/* Disable interrupts by clearing the interrupt mask. */
+	RTL_W16 ( IntrMask, 0x0000);
 
-	return 0;
+	/* Stop a shared interrupt from scavenging while we are. */
+	spin_lock_irq (&priv->lock);
+	rtl8169_tx_clear (priv);
+	spin_unlock_irq (&priv->lock);
 
-err_out:
-	rtl8169_rx_clear(tp);
-	return -ENOMEM;
-}
 
-static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
-				 struct TxDesc *desc)
-{
-	unsigned int len = tx_skb->len;
+	rtl8169_hw_start (dev);
 
-	pci_unmap_single(pdev, le64_to_cpu(desc->addr), len, PCI_DMA_TODEVICE);
-	desc->opts1 = 0x00;
-	desc->opts2 = 0x00;
-	desc->addr = 0x00;
-	tx_skb->len = 0;
+	netif_wake_queue (dev);
 }
 
-static void rtl8169_tx_clear(struct rtl8169_private *tp)
-{
-	unsigned int i;
 
-	for (i = tp->dirty_tx; i < tp->dirty_tx + NUM_TX_DESC; i++) {
-		unsigned int entry = i % NUM_TX_DESC;
-		struct ring_info *tx_skb = tp->tx_skb + entry;
-		unsigned int len = tx_skb->len;
 
-		if (len) {
-			struct sk_buff *skb = tx_skb->skb;
 
-			rtl8169_unmap_tx_skb(tp->pci_dev, tx_skb,
-					     tp->TxDescArray + entry);
-			if (skb) {
-				dev_kfree_skb(skb);
-				tx_skb->skb = NULL;
-			}
-			tp->stats.tx_dropped++;
-		}
-	}
-	tp->cur_tx = tp->dirty_tx = 0;
-}
 
-static void rtl8169_schedule_work(struct net_device *dev, void (*task)(void *))
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
 
-	PREPARE_WORK(&tp->task, task, dev);
-	schedule_delayed_work(&tp->task, 4);
-}
 
-static void rtl8169_wait_for_quiescence(struct net_device *dev)
+//======================================================================================================
+static int rtl8169_start_xmit (struct sk_buff *skb, struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-
-	synchronize_irq(dev->irq);
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	struct pci_dev *pdev = priv->pci_dev;
+	int entry = priv->cur_tx % NUM_TX_DESC;
+	int buf_len = 60;
+	dma_addr_t txbuf_dma_addr;
 
-	/* Wait for any pending NAPI task to complete */
-	netif_poll_disable(dev);
+	spin_lock_irq (&priv->lock);
 
-	rtl8169_irq_mask_and_ack(ioaddr);
-
-	netif_poll_enable(dev);
-}
+	if( (le32_to_cpu(priv->TxDescArray[entry].status) & OWNbit)==0 ){
 
-static void rtl8169_reinit_task(void *_data)
-{
-	struct net_device *dev = _data;
-	int ret;
-
-	if (netif_running(dev)) {
-		rtl8169_wait_for_quiescence(dev);
-		rtl8169_close(dev);
-	}
+		priv->Tx_skbuff[entry] = skb;
+		txbuf_dma_addr = pci_map_single(pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
+		
+		priv->TxDescArray[entry].buf_addr = cpu_to_le32(txbuf_dma_addr);
+		DBG_PRINT("%s: TX pkt_size = %d\n", __FUNCTION__, skb->len);
+		if( skb->len <= priv->tx_pkt_len ){
+			buf_len = skb->len;
+		}
+		else{
+			printk("%s: Error -- Tx packet size(%d) > mtu(%d)+14\n", dev->name, skb->len, dev->mtu);
+			buf_len = priv->tx_pkt_len;
+		}
 
-	ret = rtl8169_open(dev);
-	if (unlikely(ret < 0)) {
-		if (net_ratelimit()) {
-			printk(PFX KERN_ERR "%s: reinit failure (status = %d)."
-			       " Rescheduling.\n", dev->name, ret);
+		if( entry != (NUM_TX_DESC-1) ){
+			priv->TxDescArray[entry].status = cpu_to_le32((OWNbit | FSbit | LSbit) | buf_len);
+		}
+		else{
+			priv->TxDescArray[entry].status = cpu_to_le32((OWNbit | EORbit | FSbit | LSbit) | buf_len);
 		}
-		rtl8169_schedule_work(dev, rtl8169_reinit_task);
-	}
-}
 
-static void rtl8169_reset_task(void *_data)
-{
-	struct net_device *dev = _data;
-	struct rtl8169_private *tp = netdev_priv(dev);
+		pci_dma_sync_single_for_device(pdev, priv->txdesc_array_dma_addr[entry], sizeof(struct TxDesc), PCI_DMA_TODEVICE);
 
-	if (!netif_running(dev))
-		return;
+		RTL_W8 ( TxPoll, 0x40);		//set polling bit
 
-	rtl8169_wait_for_quiescence(dev);
+		dev->trans_start = jiffies;
 
-	rtl8169_rx_interrupt(dev, tp, tp->mmio_addr);
-	rtl8169_tx_clear(tp);
+		priv->stats.tx_bytes += ( (skb->len > ETH_ZLEN) ? skb->len : ETH_ZLEN);
+		priv->cur_tx++;
+	}//end of if( (priv->TxDescArray[entry].status & 0x80000000)==0 )
 
-	if (tp->dirty_rx == tp->cur_rx) {
-		rtl8169_init_ring_indexes(tp);
-		rtl8169_hw_start(dev);
-		netif_wake_queue(dev);
-	} else {
-		if (net_ratelimit()) {
-			printk(PFX KERN_EMERG "%s: Rx buffers shortage\n",
-			       dev->name);
+	spin_unlock_irq (&priv->lock);
+
+	if ( (priv->cur_tx - NUM_TX_DESC) == priv->dirty_tx ){
+		netif_stop_queue (dev);
+	}
+	else{
+		if (netif_queue_stopped (dev)){
+			netif_wake_queue (dev);
 		}
-		rtl8169_schedule_work(dev, rtl8169_reset_task);
 	}
-}
-
-static void rtl8169_tx_timeout(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-
-	rtl8169_hw_reset(tp->mmio_addr);
 
-	/* Let's wait a bit while any (async) irq lands on */
-	rtl8169_schedule_work(dev, rtl8169_reset_task);
+	return 0;
 }
 
-static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
-			      u32 opts1)
-{
-	struct skb_shared_info *info = skb_shinfo(skb);
-	unsigned int cur_frag, entry;
-	struct TxDesc *txd;
-
-	entry = tp->cur_tx;
-	for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) {
-		skb_frag_t *frag = info->frags + cur_frag;
-		dma_addr_t mapping;
-		u32 status, len;
-		void *addr;
-
-		entry = (entry + 1) % NUM_TX_DESC;
-
-		txd = tp->TxDescArray + entry;
-		len = frag->size;
-		addr = ((void *) page_address(frag->page)) + frag->page_offset;
-		mapping = pci_map_single(tp->pci_dev, addr, len, PCI_DMA_TODEVICE);
 
-		/* anti gcc 2.95.3 bugware (sic) */
-		status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC));
 
-		txd->opts1 = cpu_to_le32(status);
-		txd->addr = cpu_to_le64(mapping);
 
-		tp->tx_skb[entry].len = len;
-	}
 
-	if (cur_frag) {
-		tp->tx_skb[entry].skb = skb;
-		txd->opts1 |= cpu_to_le32(LastFrag);
-	}
 
-	return cur_frag;
-}
 
-static inline u32 rtl8169_tso_csum(struct sk_buff *skb, struct net_device *dev)
+//======================================================================================================
+static void rtl8169_tx_interrupt (struct net_device *dev, struct rtl8169_private *priv, unsigned long ioaddr)
 {
-	if (dev->features & NETIF_F_TSO) {
-		u32 mss = skb_shinfo(skb)->tso_size;
-
-		if (mss)
-			return LargeSend | ((mss & MSSMask) << MSSShift);
+	unsigned long dirty_tx, tx_left=0;
+	int entry = priv->cur_tx % NUM_TX_DESC;
+    	int txloop_cnt = 0;
+
+	assert (dev != NULL);
+	assert (priv != NULL);
+	assert (ioaddr != NULL);
+
+
+	dirty_tx = priv->dirty_tx;
+	tx_left = priv->cur_tx - dirty_tx;
+
+	while( (tx_left > 0) && (txloop_cnt < max_interrupt_work) ){
+		if( (le32_to_cpu(priv->TxDescArray[entry].status) & OWNbit) == 0 ){
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+			r8169_callback_tx(&(priv->rt), 1, priv->Tx_skbuff[dirty_tx % NUM_TX_DESC]->len);
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+			dev_kfree_skb_irq( priv->Tx_skbuff[dirty_tx % NUM_TX_DESC] );
+			priv->Tx_skbuff[dirty_tx % NUM_TX_DESC] = NULL;
+			priv->stats.tx_packets++;
+			dirty_tx++;
+			tx_left--;
+			entry++;
+		}
+		txloop_cnt ++;
 	}
-	if (skb->ip_summed == CHECKSUM_HW) {
-		const struct iphdr *ip = skb->nh.iph;
 
-		if (ip->protocol == IPPROTO_TCP)
-			return IPCS | TCPCS;
-		else if (ip->protocol == IPPROTO_UDP)
-			return IPCS | UDPCS;
-		WARN_ON(1);	/* we need a WARN() */
+	if (priv->dirty_tx != dirty_tx) {
+		priv->dirty_tx = dirty_tx;
+		if (netif_queue_stopped (dev))
+			netif_wake_queue (dev);
 	}
-	return 0;
 }
 
-static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	unsigned int frags, entry = tp->cur_tx % NUM_TX_DESC;
-	struct TxDesc *txd = tp->TxDescArray + entry;
-	void __iomem *ioaddr = tp->mmio_addr;
-	dma_addr_t mapping;
-	u32 status, len;
-	u32 opts1;
-	int ret = 0;
-	
-	if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) {
-		printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
-		       dev->name);
-		goto err_stop;
-	}
 
-	if (unlikely(le32_to_cpu(txd->opts1) & DescOwn))
-		goto err_stop;
 
-	opts1 = DescOwn | rtl8169_tso_csum(skb, dev);
 
-	frags = rtl8169_xmit_frags(tp, skb, opts1);
-	if (frags) {
-		len = skb_headlen(skb);
-		opts1 |= FirstFrag;
-	} else {
-		len = skb->len;
 
-		if (unlikely(len < ETH_ZLEN)) {
-			skb = skb_padto(skb, ETH_ZLEN);
-			if (!skb)
-				goto err_update_stats;
-			len = ETH_ZLEN;
-		}
 
-		opts1 |= FirstFrag | LastFrag;
-		tp->tx_skb[entry].skb = skb;
-	}
+//======================================================================================================
+static void rtl8169_rx_interrupt (struct net_device *dev, struct rtl8169_private *priv, unsigned long ioaddr)
+{
+	struct pci_dev *pdev = priv->pci_dev;
+	int cur_rx;
+	int pkt_size = 0 ;
+	int rxdesc_cnt = 0;
+	int ret;
+	struct sk_buff *n_skb = NULL;
+	struct sk_buff *cur_skb;
+	struct sk_buff *rx_skb;
+	struct	RxDesc	*rxdesc;
+
+	assert (dev != NULL);
+	assert (priv != NULL);
+	assert (ioaddr != NULL);
+
+
+	cur_rx = priv->cur_rx;
+
+	rxdesc = &priv->RxDescArray[cur_rx];
+	pci_dma_sync_single_for_device(pdev, priv->rxdesc_array_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE);
+
+	while ( ((le32_to_cpu(rxdesc->status) & OWNbit)== 0) && (rxdesc_cnt < max_interrupt_work) ){
+
+	    rxdesc_cnt++;
+
+	    if( le32_to_cpu(rxdesc->status) & RxRES ){
+			printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name);
+			priv->stats.rx_errors++;
+			if ( le32_to_cpu(rxdesc->status) & (RxRWT|RxRUNT) )
+				priv->stats.rx_length_errors++;
+			if ( le32_to_cpu(rxdesc->status) & RxCRC)
+				priv->stats.rx_crc_errors++;
+	    }
+	    else{
+			pkt_size=(int)(le32_to_cpu(rxdesc->status) & 0x00001FFF)-4;
+
+			if( pkt_size > priv->rx_pkt_len ){
+				printk("%s: Error -- Rx packet size(%d) > mtu(%d)+14\n", dev->name, pkt_size, dev->mtu);
+				pkt_size = priv->rx_pkt_len;
+			}
 
-	mapping = pci_map_single(tp->pci_dev, skb->data, len, PCI_DMA_TODEVICE);
+			DBG_PRINT("%s: RX pkt_size = %d\n", __FUNCTION__, pkt_size);
 
-	tp->tx_skb[entry].len = len;
-	txd->addr = cpu_to_le64(mapping);
-	txd->opts2 = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb));
+			{// -----------------------------------------------------
+				rx_skb = priv->Rx_skbuff[cur_rx];
+				n_skb = RTL8169_ALLOC_RXSKB(MAX_RX_SKBDATA_SIZE);
+				if( n_skb != NULL ) {
+					skb_reserve (n_skb, 2);	// 16 byte align the IP fields. //
 
-	wmb();
+					// Indicate rx_skb
+					if( rx_skb != NULL ){
+						rx_skb->dev = dev;
+						pci_dma_sync_single_for_device(pdev, priv->rx_skbuff_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE);
 
-	/* anti gcc 2.95.3 bugware (sic) */
-	status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC));
-	txd->opts1 = cpu_to_le32(status);
+						skb_put ( rx_skb, pkt_size );
+						rx_skb->protocol = eth_type_trans ( rx_skb, dev );
+						ret = RTL8169_NETIF_RX (rx_skb);
 
-	dev->trans_start = jiffies;
+//						dev->last_rx = jiffies;
+						priv->stats.rx_bytes += pkt_size;
+						priv->stats.rx_packets++;
 
-	tp->cur_tx += frags + 1;
+#ifdef RTL8169_DYNAMIC_CONTROL
+						r8169_callback_rx( &(priv->rt), 1, pkt_size);
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
 
-	smp_wmb();
+					}//end if( rx_skb != NULL )
 
-	RTL_W8(TxPoll, 0x40);	/* set polling bit */
+					priv->Rx_skbuff[cur_rx] = n_skb;
+				}
+				else{
+					DBG_PRINT("%s: Allocate n_skb failed!\n",__FUNCTION__ );
+					priv->Rx_skbuff[cur_rx] = rx_skb;
+				}
 
-	if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) {
-		netif_stop_queue(dev);
-		smp_rmb();
-		if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)
-			netif_wake_queue(dev);
-	}
 
-out:
-	return ret;
+				// Update rx descriptor
+				if( cur_rx == (NUM_RX_DESC-1) ){
+					priv->RxDescArray[cur_rx].status  = cpu_to_le32((OWNbit | EORbit) | (unsigned long)priv->hw_rx_pkt_len);
+				}
+				else{
+					priv->RxDescArray[cur_rx].status  = cpu_to_le32(OWNbit | (unsigned long)priv->hw_rx_pkt_len);
+				}
 
-err_stop:
-	netif_stop_queue(dev);
-	ret = 1;
-err_update_stats:
-	tp->stats.tx_dropped++;
-	goto out;
-}
+				cur_skb = priv->Rx_skbuff[cur_rx];
 
-static void rtl8169_pcierr_interrupt(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	struct pci_dev *pdev = tp->pci_dev;
-	void __iomem *ioaddr = tp->mmio_addr;
-	u16 pci_status, pci_cmd;
+				if( cur_skb != NULL ){
+					priv->rx_skbuff_dma_addr[cur_rx] = pci_map_single(pdev, cur_skb->data, MAX_RX_SKBDATA_SIZE, PCI_DMA_FROMDEVICE);
+					rxdesc->buf_addr = cpu_to_le32(priv->rx_skbuff_dma_addr[cur_rx]);
+				}
+				else{
+					DBG_PRINT("%s: %s() cur_skb == NULL\n", dev->name, __FUNCTION__);
+				}
 
-	pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd);
-	pci_read_config_word(pdev, PCI_STATUS, &pci_status);
+			}//------------------------------------------------------------
 
-	printk(KERN_ERR PFX "%s: PCI error (cmd = 0x%04x, status = 0x%04x).\n",
-	       dev->name, pci_cmd, pci_status);
+	    }// end of if( priv->RxDescArray[cur_rx].status & RxRES )
 
-	/*
-	 * The recovery sequence below admits a very elaborated explanation:
-	 * - it seems to work;
-	 * - I did not see what else could be done.
-	 *
-	 * Feel free to adjust to your needs.
-	 */
-	pci_write_config_word(pdev, PCI_COMMAND,
-			      pci_cmd | PCI_COMMAND_SERR | PCI_COMMAND_PARITY);
+	    cur_rx = (cur_rx +1) % NUM_RX_DESC;
+	    rxdesc = &priv->RxDescArray[cur_rx];
+	    pci_dma_sync_single_for_device(pdev, priv->rxdesc_array_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE);
 
-	pci_write_config_word(pdev, PCI_STATUS,
-		pci_status & (PCI_STATUS_DETECTED_PARITY |
-		PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_REC_MASTER_ABORT |
-		PCI_STATUS_REC_TARGET_ABORT | PCI_STATUS_SIG_TARGET_ABORT));
+	}// end of while ( (priv->RxDescArray[cur_rx].status & 0x80000000)== 0)
 
-	/* The infamous DAC f*ckup only happens at boot time */
-	if ((tp->cp_cmd & PCIDAC) && !tp->dirty_rx && !tp->cur_rx) {
-		printk(KERN_INFO PFX "%s: disabling PCI DAC.\n", dev->name);
-		tp->cp_cmd &= ~PCIDAC;
-		RTL_W16(CPlusCmd, tp->cp_cmd);
-		dev->features &= ~NETIF_F_HIGHDMA;
-		rtl8169_schedule_work(dev, rtl8169_reinit_task);
+	if( rxdesc_cnt >= max_interrupt_work ){
+		DBG_PRINT("%s: Too much work at Rx interrupt.\n", dev->name);
 	}
 
-	rtl8169_hw_reset(ioaddr);
+	priv->cur_rx = cur_rx;
 }
 
-static void
-rtl8169_tx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
-		     void __iomem *ioaddr)
-{
-	unsigned int dirty_tx, tx_left;
 
-	assert(dev != NULL);
-	assert(tp != NULL);
-	assert(ioaddr != NULL);
 
-	dirty_tx = tp->dirty_tx;
-	smp_rmb();
-	tx_left = tp->cur_tx - dirty_tx;
 
-	while (tx_left > 0) {
-		unsigned int entry = dirty_tx % NUM_TX_DESC;
-		struct ring_info *tx_skb = tp->tx_skb + entry;
-		u32 len = tx_skb->len;
-		u32 status;
 
-		rmb();
-		status = le32_to_cpu(tp->TxDescArray[entry].opts1);
-		if (status & DescOwn)
-			break;
 
-		tp->stats.tx_bytes += len;
-		tp->stats.tx_packets++;
 
-		rtl8169_unmap_tx_skb(tp->pci_dev, tx_skb, tp->TxDescArray + entry);
 
-		if (status & LastFrag) {
-			dev_kfree_skb_irq(tx_skb->skb);
-			tx_skb->skb = NULL;
-		}
-		dirty_tx++;
-		tx_left--;
-	}
+//======================================================================================================
+/* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+static void rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+#else
+static irqreturn_t rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+#endif
+{
+	struct net_device *dev = (struct net_device *) dev_instance;
+	struct rtl8169_private *priv = dev->priv;
+	int boguscnt = max_interrupt_work;
+	unsigned long ioaddr = priv->ioaddr;
+	int status = 0;
+	irqreturn_t interrupt_handled = IRQ_NONE;
 
-	if (tp->dirty_tx != dirty_tx) {
-		tp->dirty_tx = dirty_tx;
-		smp_wmb();
-		if (netif_queue_stopped(dev) &&
-		    (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) {
-			netif_wake_queue(dev);
-		}
-	}
-}
+	RTL_W16 ( IntrMask, 0x0000);
 
-static inline int rtl8169_fragmented_frame(u32 status)
-{
-	return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag);
-}
+	do {
+		status = RTL_R16(IntrStatus);
 
-static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc)
-{
-	u32 opts1 = le32_to_cpu(desc->opts1);
-	u32 status = opts1 & RxProtoMask;
+		if (status == 0xFFFF)
+			break;
 
-	if (((status == RxProtoTCP) && !(opts1 & TCPFail)) ||
-	    ((status == RxProtoUDP) && !(opts1 & UDPFail)) ||
-	    ((status == RxProtoIP) && !(opts1 & IPFail)))
-		skb->ip_summed = CHECKSUM_UNNECESSARY;
-	else
-		skb->ip_summed = CHECKSUM_NONE;
-}
 
-static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size,
-				      struct RxDesc *desc, int rx_buf_sz)
-{
-	int ret = -1;
+		RTL_W16( IntrStatus, status );
 
-	if (pkt_size < rx_copybreak) {
-		struct sk_buff *skb;
 
-		skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN);
-		if (skb) {
-			skb_reserve(skb, NET_IP_ALIGN);
-			eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
-			*sk_buff = skb;
-			rtl8169_mark_to_asic(desc, rx_buf_sz);
-			ret = 0;
-		}
-	}
-	return ret;
-}
+		if ( (status & rtl8169_intr_mask ) == 0 )
+			break;
+		else
+			interrupt_handled = IRQ_HANDLED;
 
-static int
-rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
-		     void __iomem *ioaddr)
-{
-	unsigned int cur_rx, rx_left;
-	unsigned int delta, count;
 
-	assert(dev != NULL);
-	assert(tp != NULL);
-	assert(ioaddr != NULL);
+		// Rx interrupt
+//		if (status & (RxOK | RxErr /* | LinkChg | RxOverflow | RxFIFOOver*/)){
+			rtl8169_rx_interrupt (dev, priv, ioaddr);
+//		}
+
+		// Tx interrupt
+//		if (status & (TxOK | TxErr)) {
+			spin_lock (&priv->lock);
+			rtl8169_tx_interrupt (dev, priv, ioaddr);
+			spin_unlock (&priv->lock);
+//		}
 
-	cur_rx = tp->cur_rx;
-	rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx;
-	rx_left = rtl8169_rx_quota(rx_left, (u32) dev->quota);
+		boguscnt--;
+	} while (boguscnt > 0);
 
-	while (rx_left > 0) {
-		unsigned int entry = cur_rx % NUM_RX_DESC;
-		struct RxDesc *desc = tp->RxDescArray + entry;
-		u32 status;
+	if (boguscnt <= 0) {
+		DBG_PRINT("%s: Too much work at interrupt!\n", dev->name);
+		RTL_W16( IntrStatus, 0xffff);	// Clear all interrupt sources
+	}
 
-		rmb();
-		status = le32_to_cpu(desc->opts1);
+	RTL_W16 ( IntrMask, rtl8169_intr_mask);
 
-		if (status & DescOwn)
-			break;
-		if (status & RxRES) {
-			printk(KERN_INFO "%s: Rx ERROR. status = %08x\n",
-			       dev->name, status);
-			tp->stats.rx_errors++;
-			if (status & (RxRWT | RxRUNT))
-				tp->stats.rx_length_errors++;
-			if (status & RxCRC)
-				tp->stats.rx_crc_errors++;
-			rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
-		} else {
-			struct sk_buff *skb = tp->Rx_skbuff[entry];
-			int pkt_size = (status & 0x00001FFF) - 4;
-			void (*pci_action)(struct pci_dev *, dma_addr_t,
-				size_t, int) = pci_dma_sync_single_for_device;
-
-			/*
-			 * The driver does not support incoming fragmented
-			 * frames. They are seen as a symptom of over-mtu
-			 * sized frames.
-			 */
-			if (unlikely(rtl8169_fragmented_frame(status))) {
-				tp->stats.rx_dropped++;
-				tp->stats.rx_length_errors++;
-				rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
-				goto move_on;
-			}
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
+	return interrupt_handled;
+#endif
+}
 
-			rtl8169_rx_csum(skb, desc);
-			
-			pci_dma_sync_single_for_cpu(tp->pci_dev,
-				le64_to_cpu(desc->addr), tp->rx_buf_sz,
-				PCI_DMA_FROMDEVICE);
-
-			if (rtl8169_try_rx_copy(&skb, pkt_size, desc,
-						tp->rx_buf_sz)) {
-				pci_action = pci_unmap_single;
-				tp->Rx_skbuff[entry] = NULL;
-			}
 
-			pci_action(tp->pci_dev, le64_to_cpu(desc->addr),
-				   tp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 
-			skb->dev = dev;
-			skb_put(skb, pkt_size);
-			skb->protocol = eth_type_trans(skb, dev);
-
-			if (rtl8169_rx_vlan_skb(tp, desc, skb) < 0)
-				rtl8169_rx_skb(skb);
-
-			dev->last_rx = jiffies;
-			tp->stats.rx_bytes += pkt_size;
-			tp->stats.rx_packets++;
-		}
-move_on:		
-		cur_rx++; 
-		rx_left--;
-	}
-
-	count = cur_rx - tp->cur_rx;
-	tp->cur_rx = cur_rx;
-
-	delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx);
-	if (!delta && count)
-		printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name);
-	tp->dirty_rx += delta;
-
-	/*
-	 * FIXME: until there is periodic timer to try and refill the ring,
-	 * a temporary shortage may definitely kill the Rx process.
-	 * - disable the asic to try and avoid an overflow and kick it again
-	 *   after refill ?
-	 * - how do others driver handle this condition (Uh oh...).
-	 */
-	if (tp->dirty_rx + NUM_RX_DESC == tp->cur_rx)
-		printk(KERN_EMERG "%s: Rx buffers exhausted\n", dev->name);
 
-	return count;
-}
 
-/* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */
-static irqreturn_t
-rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+
+
+//======================================================================================================
+static int rtl8169_close (struct net_device *dev)
 {
-	struct net_device *dev = (struct net_device *) dev_instance;
-	struct rtl8169_private *tp = netdev_priv(dev);
-	int boguscnt = max_interrupt_work;
-	void __iomem *ioaddr = tp->mmio_addr;
-	int status;
-	int handled = 0;
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	int i;
 
-	do {
-		status = RTL_R16(IntrStatus);
+	// -----------------------------------------
+	rtl8169_delete_timer( &(priv->r8169_timer) );
 
-		/* hotplug/major error/no more work/shared irq */
-		if ((status == 0xFFFF) || !status)
-			break;
 
-		handled = 1;
+	netif_stop_queue (dev);
 
-		if (unlikely(!netif_running(dev))) {
-			rtl8169_asic_down(ioaddr);
-			goto out;
-		}
+	spin_lock_irq (&priv->lock);
 
-		status &= tp->intr_mask;
-		RTL_W16(IntrStatus,
-			(status & RxFIFOOver) ? (status | RxOverflow) : status);
+	/* Stop the chip's Tx and Rx processes. */
+	RTL_W8 ( ChipCmd, 0x00);
 
-		if (!(status & rtl8169_intr_mask))
-			break;
+	/* Disable interrupts by clearing the interrupt mask. */
+	RTL_W16 ( IntrMask, 0x0000);
 
-		if (unlikely(status & SYSErr)) {
-			rtl8169_pcierr_interrupt(dev);
-			break;
-		}
+	/* Update the error counts. */
+	priv->stats.rx_missed_errors += RTL_R32(RxMissed);
+	RTL_W32( RxMissed, 0);
 
-		if (status & LinkChg)
-			rtl8169_check_link_status(dev, tp, ioaddr);
+	spin_unlock_irq (&priv->lock);
 
-#ifdef CONFIG_R8169_NAPI
-		RTL_W16(IntrMask, rtl8169_intr_mask & ~rtl8169_napi_event);
-		tp->intr_mask = ~rtl8169_napi_event;
-
-		if (likely(netif_rx_schedule_prep(dev)))
-			__netif_rx_schedule(dev);
-		else {
-			printk(KERN_INFO "%s: interrupt %04x taken in poll\n",
-			       dev->name, status);	
-		}
-		break;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	synchronize_irq ();
 #else
-		/* Rx interrupt */
-		if (status & (RxOK | RxOverflow | RxFIFOOver)) {
-			rtl8169_rx_interrupt(dev, tp, ioaddr);
-		}
-		/* Tx interrupt */
-		if (status & (TxOK | TxErr))
-			rtl8169_tx_interrupt(dev, tp, ioaddr);
+	synchronize_irq (dev->irq);
 #endif
+	free_irq (dev->irq, dev);
 
-		boguscnt--;
-	} while (boguscnt > 0);
+	rtl8169_tx_clear (priv);
+	
+	//2004-05-11
+	if(priv->txdesc_space != NULL){
+		pci_free_consistent(
+				priv->pci_dev,
+				priv->sizeof_txdesc_space,
+				priv->txdesc_space,
+				priv->txdesc_phy_dma_addr
+		);
+		priv->txdesc_space = NULL;
+	}
+
+	if(priv->rxdesc_space != NULL){
+		pci_free_consistent(
+				priv->pci_dev,
+				priv->sizeof_rxdesc_space,
+				priv->rxdesc_space,
+				priv->rxdesc_phy_dma_addr
+		);
+		priv->rxdesc_space = NULL;
+	}
+
+	priv->TxDescArray = NULL;
+	priv->RxDescArray = NULL;
+
+	{//-----------------------------------------------------------------------------
+		for(i=0;i<NUM_RX_DESC;i++){
+			if( priv->Rx_skbuff[i] != NULL ) {
+				RTL8169_FREE_RXSKB ( priv->Rx_skbuff[i] );
+			}
+		}
+	}//-----------------------------------------------------------------------------
 
-	if (boguscnt <= 0) {
-		printk(KERN_WARNING "%s: Too much work at interrupt!\n",
-		       dev->name);
-		/* Clear all interrupt sources. */
-		RTL_W16(IntrStatus, 0xffff);
-	}
-out:
-	return IRQ_RETVAL(handled);
-}
-
-#ifdef CONFIG_R8169_NAPI
-static int rtl8169_poll(struct net_device *dev, int *budget)
-{
-	unsigned int work_done, work_to_do = min(*budget, dev->quota);
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-
-	work_done = rtl8169_rx_interrupt(dev, tp, ioaddr);
-	rtl8169_tx_interrupt(dev, tp, ioaddr);
-
-	*budget -= work_done;
-	dev->quota -= work_done;
-
-	if (work_done < work_to_do) {
-		netif_rx_complete(dev);
-		tp->intr_mask = 0xffff;
-		/*
-		 * 20040426: the barrier is not strictly required but the
-		 * behavior of the irq handler could be less predictable
-		 * without it. Btw, the lack of flush for the posted pci
-		 * write is safe - FR
-		 */
-		smp_wmb();
-		RTL_W16(IntrMask, rtl8169_intr_mask);
-	}
+	DBG_PRINT("%s: %s() alloc_rxskb_cnt = %d\n", dev->name, __FUNCTION__, alloc_rxskb_cnt );
 
-	return (work_done >= work_to_do);
+	return 0;
 }
-#endif
 
-static void rtl8169_down(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	unsigned int poll_locked = 0;
 
-	rtl8169_delete_timer(dev);
 
-	netif_stop_queue(dev);
 
-	flush_scheduled_work();
 
-core_down:
-	spin_lock_irq(&tp->lock);
 
-	rtl8169_asic_down(ioaddr);
 
-	/* Update the error counts. */
-	tp->stats.rx_missed_errors += RTL_R32(RxMissed);
-	RTL_W32(RxMissed, 0);
-
-	spin_unlock_irq(&tp->lock);
-
-	synchronize_irq(dev->irq);
+//======================================================================================================
+static unsigned const ethernet_polynomial = 0x04c11db7U;
+static inline u32 ether_crc (int length, unsigned char *data)
+{
+	int crc = -1;
 
-	if (!poll_locked) {
-		netif_poll_disable(dev);
-		poll_locked++;
+	while (--length >= 0) {
+		unsigned char current_octet = *data++;
+		int bit;
+		for (bit = 0; bit < 8; bit++, current_octet >>= 1)
+			crc = (crc << 1) ^ ((crc < 0) ^ (current_octet & 1) ? ethernet_polynomial : 0);
 	}
 
-	/* Give a racing hard_start_xmit a few cycles to complete. */
-	synchronize_sched();  /* FIXME: should this be synchronize_irq()? */
-
-	/*
-	 * And now for the 50k$ question: are IRQ disabled or not ?
-	 *
-	 * Two paths lead here:
-	 * 1) dev->close
-	 *    -> netif_running() is available to sync the current code and the
-	 *       IRQ handler. See rtl8169_interrupt for details.
-	 * 2) dev->change_mtu
-	 *    -> rtl8169_poll can not be issued again and re-enable the
-	 *       interruptions. Let's simply issue the IRQ down sequence again.
-	 */
-	if (RTL_R16(IntrMask))
-		goto core_down;
-
-	rtl8169_tx_clear(tp);
-
-	rtl8169_rx_clear(tp);
+	return crc;
 }
 
-static int rtl8169_close(struct net_device *dev)
-{
-	struct rtl8169_private *tp = netdev_priv(dev);
-	struct pci_dev *pdev = tp->pci_dev;
 
-	rtl8169_down(dev);
 
-	free_irq(dev->irq, dev);
 
-	netif_poll_enable(dev);
 
-	pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray,
-			    tp->RxPhyAddr);
-	pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray,
-			    tp->TxPhyAddr);
-	tp->TxDescArray = NULL;
-	tp->RxDescArray = NULL;
 
-	return 0;
-}
 
-static void
-rtl8169_set_rx_mode(struct net_device *dev)
+
+//======================================================================================================
+static void rtl8169_set_rx_mode (struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
 	unsigned long flags;
 	u32 mc_filter[2];	/* Multicast hash filter */
 	int i, rx_mode;
-	u32 tmp = 0;
+	u32 tmp=0;
+	
 
 	if (dev->flags & IFF_PROMISC) {
 		/* Unconditionally log net taps. */
-		printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n",
-		       dev->name);
-		rx_mode =
-		    AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
-		    AcceptAllPhys;
+		printk (KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
+		rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptAllPhys;
 		mc_filter[1] = mc_filter[0] = 0xffffffff;
-	} else if ((dev->mc_count > multicast_filter_limit)
-		   || (dev->flags & IFF_ALLMULTI)) {
+	} else if ((dev->mc_count > multicast_filter_limit) || (dev->flags & IFF_ALLMULTI)) {
 		/* Too many to filter perfectly -- accept all multicasts. */
 		rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
 		mc_filter[1] = mc_filter[0] = 0xffffffff;
 	} else {
 		struct dev_mc_list *mclist;
-		rx_mode = AcceptBroadcast | AcceptMyPhys;
+		rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
 		mc_filter[1] = mc_filter[0] = 0;
-		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-		     i++, mclist = mclist->next) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next)
+		{
+			set_bit (ether_crc (ETH_ALEN, mclist->dmi_addr) >> 26, mc_filter);
+		}			
+#else
+		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next)
+		{
 			int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
+			                                                                                                     
 			mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
 			rx_mode |= AcceptMulticast;
 		}
+#endif		
 	}
 
-	spin_lock_irqsave(&tp->lock, flags);
+	spin_lock_irqsave (&priv->lock, flags);
 
-	tmp = rtl8169_rx_config | rx_mode |
-	      (RTL_R32(RxConfig) & rtl_chip_info[tp->chipset].RxConfigMask);
+	tmp = rtl8169_rx_config | rx_mode | (RTL_R32(RxConfig) & rtl_chip_info[priv->chipset].RxConfigMask);
+
+	RTL_W32 ( RxConfig, tmp);
+	RTL_W32 ( MAR0 + 0, mc_filter[0]);
+	RTL_W32 ( MAR0 + 4, mc_filter[1]);
+
+	spin_unlock_irqrestore (&priv->lock, flags);
+
+}//end of rtl8169_set_rx_mode (struct net_device *dev)
 
-	RTL_W32(RxConfig, tmp);
-	RTL_W32(MAR0 + 0, mc_filter[0]);
-	RTL_W32(MAR0 + 4, mc_filter[1]);
 
-	spin_unlock_irqrestore(&tp->lock, flags);
-}
 
-/**
- *  rtl8169_get_stats - Get rtl8169 read/write statistics
- *  @dev: The Ethernet Device to get statistics for
- *
- *  Get TX/RX statistics for rtl8169
- */
-static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
+
+
+
+
+//================================================================================
+struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
+
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-	unsigned long flags;
+	struct rtl8169_private *priv = dev->priv;
 
-	if (netif_running(dev)) {
-		spin_lock_irqsave(&tp->lock, flags);
-		tp->stats.rx_missed_errors += RTL_R32(RxMissed);
-		RTL_W32(RxMissed, 0);
-		spin_unlock_irqrestore(&tp->lock, flags);
-	}
-		
-	return &tp->stats;
+    return &priv->stats;
 }
 
+
+
+
+
+
+
+
+//================================================================================
 static struct pci_driver rtl8169_pci_driver = {
-	.name		= MODULENAME,
-	.id_table	= rtl8169_pci_tbl,
-	.probe		= rtl8169_init_one,
-	.remove		= __devexit_p(rtl8169_remove_one),
-#ifdef CONFIG_PM
-	.suspend	= rtl8169_suspend,
-	.resume		= rtl8169_resume,
-#endif
+	name:		MODULENAME,
+	id_table:	rtl8169_pci_tbl,
+	probe:		rtl8169_init_one,
+	remove:		rtl8169_remove_one,
+	suspend:	NULL,
+	resume:		NULL,
 };
 
-static int __init
-rtl8169_init_module(void)
+
+
+
+
+//======================================================================================================
+static int __init rtl8169_init_module (void)
 {
-	return pci_module_init(&rtl8169_pci_driver);
+	return pci_module_init (&rtl8169_pci_driver);	// pci_register_driver (drv)
 }
 
-static void __exit
-rtl8169_cleanup_module(void)
+
+
+
+//======================================================================================================
+static void __exit rtl8169_cleanup_module (void)
 {
-	pci_unregister_driver(&rtl8169_pci_driver);
+	pci_unregister_driver (&rtl8169_pci_driver);
 }
 
+
+#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
+{
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+
+	if( new_mtu > MAX_JUMBO_FRAME_MTU ){
+		printk("%s: Error -- new_mtu(%d) > MAX_JUMBO_FRAME_MTU(%d).\n", dev->name, new_mtu, MAX_JUMBO_FRAME_MTU);
+		return -1;
+	}
+
+	dev->mtu = new_mtu;
+
+	priv->curr_mtu_size = new_mtu;
+	priv->tx_pkt_len = new_mtu + ETH_HDR_LEN;
+	priv->rx_pkt_len = new_mtu + ETH_HDR_LEN;
+	priv->hw_rx_pkt_len = priv->rx_pkt_len + 8;
+
+	RTL_W8 ( Cfg9346, Cfg9346_Unlock);
+	RTL_W16	( RxMaxSize, (unsigned short)priv->hw_rx_pkt_len );
+	RTL_W8 ( Cfg9346, Cfg9346_Lock);
+
+	DBG_PRINT("-------------------------- \n");
+	DBG_PRINT("dev->mtu = %d \n", dev->mtu);
+	DBG_PRINT("priv->curr_mtu_size = %d \n", priv->curr_mtu_size);
+	DBG_PRINT("priv->rx_pkt_len = %d \n", priv->rx_pkt_len);
+	DBG_PRINT("priv->tx_pkt_len = %d \n", priv->tx_pkt_len);
+	DBG_PRINT("RTL_W16( RxMaxSize, %d )\n", priv->hw_rx_pkt_len);
+	DBG_PRINT("-------------------------- \n");
+
+	rtl8169_close (dev);
+	rtl8169_open (dev);
+
+	return 0;
+}
+#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+
+
+
+
+
+
+
+
+
+
+//======================================================================================================
 module_init(rtl8169_init_module);
-module_exit(rtl8169_cleanup_module);
+  module_exit(rtl8169_cleanup_module);
diff -urN linux-original/drivers/net/r8169.iomega.c linux/drivers/net/r8169.iomega.c
--- linux-original/drivers/net/r8169.iomega.c	1969-12-31 19:00:00.000000000 -0500
+++ linux/drivers/net/r8169.iomega.c	2005-07-08 08:55:27.000000000 -0400
@@ -0,0 +1,1915 @@
+/*
+=========================================================================
+ r8169.c: A RealTek RTL8169s/8110s Gigabit Ethernet driver for Linux kernel 2.4.x.
+ --------------------------------------------------------------------
+
+ History:
+ Feb  4 2002	- created initially by ShuChen <shuchen@realtek.com.tw>.
+ May 20 2002	- Add link status force-mode and TBI mode support.
+=========================================================================
+
+RTL8169_VERSION "1.1"	<2002/10/4>
+
+	The bit4:0 of MII register 4 is called "selector field", and have to be
+	00001b to indicate support of IEEE std 802.3 during NWay process of
+	exchanging Link Code Word (FLP).
+
+RTL8169_VERSION "1.2"	<2003/6/17>
+	Update driver module name.
+	Modify ISR.
+        Add chip mcfg.
+
+RTL8169_VERSION "1.3"	<2003/6/20>
+        Add chip pcfg.
+	Add priv->phy_timer_t, rtl8169_phy_timer_t_handler()
+	Add rtl8169_hw_PHY_config()
+	Add rtl8169_hw_PHY_reset()
+
+RTL8169_VERSION "1.4"	<2003/7/14>
+	Add tx_bytes, rx_bytes.
+
+RTL8169_VERSION "1.5"	<2003/7/18>
+	Set 0x0000 to PHY at offset 0x0b.
+	Modify chip mcfg, pcfg
+	Force media for multiple card.
+RTL8169_VERSION "1.6"	<2003/8/25>
+	Modify receive data buffer.
+
+RTL8169_VERSION "1.7"	<2003/9/18>
+	Add Jumbo Frame support.
+
+RTL8169_VERSION "1.8"	<2003/10/21>
+	Performance and CPU Utilizaion Enhancement.
+
+RTL8169_VERSION "1.9"	<2003/12/29>
+	Enable Tx/Rx flow control.
+
+RTL8169_VERSION "2.0"	<2004/03/26>
+	Beta version.
+	Support for linux 2.6.x
+
+RTL8169_VERSION "2.1"	<2004/07/05>
+	Modify parameters.
+
+RTL8169_VERSION "2.2"	<2004/08/09>
+	Add.pci_dma_sync_single.
+	Add pci_alloc_consistent()/pci_free_consistent().
+	Revise parameters.
+	Recognize our interrupt for linux 2.6.x.
+*/
+
+
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/delay.h>
+#include <linux/version.h>
+
+#include <linux/timer.h>
+#include <linux/init.h>
+
+
+#define RTL8169_VERSION "2.2"
+#define MODULENAME "RTL8169s/8110s"
+#define RTL8169_DRIVER_NAME   MODULENAME " Gigabit Ethernet driver " RTL8169_VERSION
+#define PFX MODULENAME ": "
+
+
+#undef RTL8169_DEBUG
+#undef RTL8169_JUMBO_FRAME_SUPPORT
+#undef	RTL8169_HW_FLOW_CONTROL_SUPPORT
+
+
+#undef RTL8169_IOCTL_SUPPORT
+#undef RTL8169_DYNAMIC_CONTROL
+#define RTL8169_USE_IO
+
+
+#ifdef RTL8169_DEBUG
+	#define assert(expr) \
+        	if(!(expr)) { printk( "Assertion failed! %s,%s,%s,line=%d\n", #expr,__FILE__,__FUNCTION__,__LINE__); }
+	#define DBG_PRINT( fmt, args...)   printk("r8169: " fmt, ## args);
+#else
+	#define assert(expr) do {} while (0)
+	#define DBG_PRINT( fmt, args...)   ;
+#endif	// end of #ifdef RTL8169_DEBUG
+
+
+/* media options */
+#define MAX_UNITS 8
+static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
+
+/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
+static int max_interrupt_work = 20;
+
+/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
+   The RTL chips use a 64 element hash table based on the Ethernet CRC.  */
+static int multicast_filter_limit = 32;
+
+/* MAC address length*/
+#define MAC_ADDR_LEN        6
+
+#define RX_FIFO_THRESH      7       /* 7 means NO threshold, Rx buffer level before first PCI xfer.  */
+#define RX_DMA_BURST        7       /* Maximum PCI burst, '6' is 1024 */
+#define TX_DMA_BURST        7       /* Maximum PCI burst, '6' is 1024 */
+#define ETTh                0x3F    /* 0x3F means NO threshold */
+
+#define ETH_HDR_LEN         14
+#define DEFAULT_MTU         1500
+#define DEFAULT_RX_BUF_LEN  1536
+
+
+#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+#define MAX_JUMBO_FRAME_MTU	( 10000 )
+#define MAX_RX_SKBDATA_SIZE	( MAX_JUMBO_FRAME_MTU + ETH_HDR_LEN )
+#else
+#define MAX_RX_SKBDATA_SIZE 1600
+#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+
+#define InterFrameGap       0x03    /* 3 means InterFrameGap = the shortest one */
+
+#define NUM_TX_DESC         64     /* Number of Tx descriptor registers*/
+#define NUM_RX_DESC         64     /* Number of Rx descriptor registers*/
+
+
+#define RTL_MIN_IO_SIZE     0x80
+#define TX_TIMEOUT          (6*HZ)
+#define RTL8169_TIMER_EXPIRE_TIME 100 //100
+
+
+#ifdef RTL8169_USE_IO
+#define RTL_W8(reg, val8)   outb ((val8), ioaddr + (reg))
+#define RTL_W16(reg, val16) outw ((val16), ioaddr + (reg))
+#define RTL_W32(reg, val32) outl ((val32), ioaddr + (reg))
+#define RTL_R8(reg)         inb (ioaddr + (reg))
+#define RTL_R16(reg)        inw (ioaddr + (reg))
+#define RTL_R32(reg)        ((unsigned long) inl (ioaddr + (reg)))
+#else
+/* write/read MMIO register */
+#define RTL_W8(reg, val8)   writeb ((val8), ioaddr + (reg))
+#define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg))
+#define RTL_W32(reg, val32) writel ((val32), ioaddr + (reg))
+#define RTL_R8(reg)         readb (ioaddr + (reg))
+#define RTL_R16(reg)        readw (ioaddr + (reg))
+#define RTL_R32(reg)        ((unsigned long) readl (ioaddr + (reg)))
+#endif
+
+#define MCFG_METHOD_1		0x01
+#define MCFG_METHOD_2		0x02
+#define MCFG_METHOD_3		0x03
+#define MCFG_METHOD_4		0x04
+
+#define PCFG_METHOD_1		0x01	//PHY Reg 0x03 bit0-3 == 0x0000
+#define PCFG_METHOD_2		0x02	//PHY Reg 0x03 bit0-3 == 0x0001
+#define PCFG_METHOD_3		0x03	//PHY Reg 0x03 bit0-3 == 0x0002
+
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+#include "r8169_callback.h"
+#endif  //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+
+const static struct {
+	const char *name;
+	u8 mcfg;		 /* depend on RTL8169 docs */
+	u32 RxConfigMask; 	/* should clear the bits supported by this chip */
+} rtl_chip_info[] = {
+	{ "RTL8169",  MCFG_METHOD_1,  0xff7e1880 },
+	{ "RTL8169s/8110s",  MCFG_METHOD_2,  0xff7e1880 },
+	{ "RTL8169s/8110s",  MCFG_METHOD_3,  0xff7e1880 },
+};
+
+
+static struct pci_device_id rtl8169_pci_tbl[] __devinitdata = {
+	{ 0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+#ifdef CONFIG_IOMEGA8241	
+	/* The 8169 without an i2c defaults to reporting as an 8129 */
+	{ 0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+#endif /* CONFIG_IOMEGA8241 */		
+	{0,},
+};
+
+
+MODULE_DEVICE_TABLE (pci, rtl8169_pci_tbl);
+
+
+enum RTL8169_registers {
+	MAC0 = 0x0,
+	MAR0 = 0x8,
+	TxDescStartAddr	= 0x20,
+	TxHDescStartAddr= 0x28,
+	FLASH	= 0x30,
+	ERSR	= 0x36,
+	ChipCmd	= 0x37,
+	TxPoll	= 0x38,
+	IntrMask = 0x3C,
+	IntrStatus = 0x3E,
+	TxConfig = 0x40,
+	RxConfig = 0x44,
+	RxMissed = 0x4C,
+	Cfg9346 = 0x50,
+	Config0	= 0x51,
+	Config1	= 0x52,
+	Config2	= 0x53,
+	Config3	= 0x54,
+	Config4	= 0x55,
+	Config5	= 0x56,
+	MultiIntr = 0x5C,
+	PHYAR	= 0x60,
+	TBICSR	= 0x64,
+	TBI_ANAR = 0x68,
+	TBI_LPAR = 0x6A,
+	PHYstatus = 0x6C,
+	RxMaxSize = 0xDA,
+	CPlusCmd = 0xE0,
+	RxDescStartAddr	= 0xE4,
+	ETThReg	= 0xEC,
+	FuncEvent	= 0xF0,
+	FuncEventMask	= 0xF4,
+	FuncPresetState	= 0xF8,
+	FuncForceEvent	= 0xFC,
+};
+
+enum RTL8169_register_content {
+	/*InterruptStatusBits*/
+	SYSErr 		= 0x8000,
+	PCSTimeout	= 0x4000,
+	SWInt		= 0x0100,
+	TxDescUnavail	= 0x80,
+	RxFIFOOver 	= 0x40,
+	LinkChg 	= 0x20,
+	RxOverflow 	= 0x10,
+	TxErr 	= 0x08,
+	TxOK 	= 0x04,
+	RxErr 	= 0x02,
+	RxOK 	= 0x01,
+
+	/*RxStatusDesc*/
+	RxRES = 0x00200000,
+	RxCRC = 0x00080000,
+	RxRUNT= 0x00100000,
+	RxRWT = 0x00400000,
+
+	/*ChipCmdBits*/
+	CmdReset = 0x10,
+	CmdRxEnb = 0x08,
+	CmdTxEnb = 0x04,
+	RxBufEmpty = 0x01,
+
+	/*Cfg9346Bits*/
+	Cfg9346_Lock = 0x00,
+	Cfg9346_Unlock = 0xC0,
+
+	/*rx_mode_bits*/
+	AcceptErr = 0x20,
+	AcceptRunt = 0x10,
+	AcceptBroadcast = 0x08,
+	AcceptMulticast = 0x04,
+	AcceptMyPhys = 0x02,
+	AcceptAllPhys = 0x01,
+
+	/*RxConfigBits*/
+	RxCfgFIFOShift = 13,
+	RxCfgDMAShift = 8,
+
+	/*TxConfigBits*/
+	TxInterFrameGapShift = 24,
+	TxDMAShift = 8,
+
+	/*rtl8169_PHYstatus*/
+	TBI_Enable	= 0x80,
+	TxFlowCtrl	= 0x40,
+	RxFlowCtrl	= 0x20,
+	_1000bpsF	= 0x10,
+	_100bps		= 0x08,
+	_10bps		= 0x04,
+	LinkStatus	= 0x02,
+	FullDup		= 0x01,
+
+	/*GIGABIT_PHY_registers*/
+	PHY_CTRL_REG = 0,
+	PHY_STAT_REG = 1,
+	PHY_AUTO_NEGO_REG = 4,
+	PHY_1000_CTRL_REG = 9,
+
+	/*GIGABIT_PHY_REG_BIT*/
+	PHY_Restart_Auto_Nego	= 0x0200,
+	PHY_Enable_Auto_Nego	= 0x1000,
+
+	//PHY_STAT_REG = 1;
+	PHY_Auto_Neco_Comp	= 0x0020,
+
+	//PHY_AUTO_NEGO_REG = 4;
+	PHY_Cap_10_Half		= 0x0020,
+	PHY_Cap_10_Full		= 0x0040,
+	PHY_Cap_100_Half	= 0x0080,
+	PHY_Cap_100_Full	= 0x0100,
+
+	//PHY_1000_CTRL_REG = 9;
+	PHY_Cap_1000_Full	= 0x0200,
+
+	PHY_Cap_PAUSE		= 0x0400,
+	PHY_Cap_ASYM_PAUSE	= 0x0800,
+
+	PHY_Cap_Null		= 0x0,
+
+	/*_MediaType*/
+	_10_Half	= 0x01,
+	_10_Full	= 0x02,
+	_100_Half	= 0x04,
+	_100_Full	= 0x08,
+	_1000_Full	= 0x10,
+
+	/*_TBICSRBit*/
+	TBILinkOK 	= 0x02000000,
+};
+
+
+
+enum _DescStatusBit {
+	OWNbit	= 0x80000000,
+	EORbit	= 0x40000000,
+	FSbit	= 0x20000000,
+	LSbit	= 0x10000000,
+};
+
+
+struct TxDesc {
+	u32		status;
+	u32		vlan_tag;
+	u32		buf_addr;
+	u32		buf_Haddr;
+};
+
+struct RxDesc {
+	u32		status;
+	u32		vlan_tag;
+	u32		buf_addr;
+	u32		buf_Haddr;
+};
+
+
+typedef struct timer_list rt_timer_t;
+
+
+struct rtl8169_private {
+	unsigned long ioaddr;                /* memory map physical address*/
+	struct pci_dev *pci_dev;                /* Index of PCI device  */
+	struct net_device_stats stats;          /* statistics of net device */
+	spinlock_t lock;                        /* spin lock flag */
+	int chipset;
+	int mcfg;
+	int pcfg;
+	rt_timer_t r8169_timer;
+	unsigned long expire_time;
+
+	unsigned long phy_link_down_cnt;
+	unsigned long cur_rx;                   /* Index into the Rx descriptor buffer of next Rx pkt. */
+	unsigned long cur_tx;                   /* Index into the Tx descriptor buffer of next Rx pkt. */
+	unsigned long dirty_tx;
+	struct	TxDesc	*TxDescArray;           /* Index of 256-alignment Tx Descriptor buffer */
+	struct	RxDesc	*RxDescArray;           /* Index of 256-alignment Rx Descriptor buffer */
+	struct	sk_buff	*Tx_skbuff[NUM_TX_DESC];/* Index of Transmit data buffer */
+	struct	sk_buff	*Rx_skbuff[NUM_RX_DESC];/* Receive data buffer */
+	unsigned char   drvinit_fail;
+
+	dma_addr_t txdesc_array_dma_addr[NUM_TX_DESC];
+	dma_addr_t rxdesc_array_dma_addr[NUM_RX_DESC];
+	dma_addr_t rx_skbuff_dma_addr[NUM_RX_DESC];
+
+	void *txdesc_space;
+	dma_addr_t txdesc_phy_dma_addr;
+	int sizeof_txdesc_space;
+
+	void *rxdesc_space;
+	dma_addr_t rxdesc_phy_dma_addr;
+	int sizeof_rxdesc_space;
+
+	int curr_mtu_size;
+	int tx_pkt_len;
+	int rx_pkt_len;
+
+	int hw_rx_pkt_len;
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+	struct r8169_cb_t rt;
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+	unsigned char   linkstatus;
+};
+
+
+MODULE_AUTHOR ("Realtek");
+MODULE_DESCRIPTION ("RealTek RTL-8169 Gigabit Ethernet driver");
+MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i");
+MODULE_LICENSE("GPL");
+
+
+static int rtl8169_open (struct net_device *dev);
+static int rtl8169_start_xmit (struct sk_buff *skb, struct net_device *dev);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+typedef	int				irqreturn_t;
+#define	IRQ_NONE		0
+#define	IRQ_HANDLED		1
+static void rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
+#else
+static irqreturn_t rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
+#endif
+
+static void rtl8169_init_ring (struct net_device *dev);
+static void rtl8169_hw_start (struct net_device *dev);
+static int rtl8169_close (struct net_device *dev);
+static inline u32 ether_crc (int length, unsigned char *data);
+static void rtl8169_set_rx_mode (struct net_device *dev);
+static void rtl8169_tx_timeout (struct net_device *dev);
+static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev);
+
+#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+static int rtl8169_change_mtu(struct net_device *dev, int new_mtu);
+#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+static void rtl8169_hw_PHY_config (struct net_device *dev);
+static void rtl8169_hw_PHY_reset(struct net_device *dev);
+static const u16 rtl8169_intr_mask = LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK ;
+static const unsigned int rtl8169_rx_config = (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift) | 0x0000000E;
+
+
+#define RTL8169_WRITE_GMII_REG_BIT( ioaddr, reg, bitnum, bitval )\
+{ \
+	int val; \
+	if( bitval == 1 ){ val = ( RTL8169_READ_GMII_REG( ioaddr, reg ) | (bitval<<bitnum) ) & 0xffff ; } \
+	else{ val = ( RTL8169_READ_GMII_REG( ioaddr, reg ) & (~(0x0001<<bitnum)) ) & 0xffff ; } \
+	RTL8169_WRITE_GMII_REG( ioaddr, reg, val ); \
+}
+
+
+
+#ifdef RTL8169_DEBUG
+unsigned alloc_rxskb_cnt = 0;
+#define RTL8169_ALLOC_RXSKB(bufsize) 	dev_alloc_skb(bufsize); alloc_rxskb_cnt ++ ;
+#define RTL8169_FREE_RXSKB(skb) 	kfree_skb(skb); alloc_rxskb_cnt -- ;
+#define RTL8169_NETIF_RX(skb) 		netif_rx(skb); alloc_rxskb_cnt -- ;
+#else
+#define RTL8169_ALLOC_RXSKB(bufsize) 	dev_alloc_skb(bufsize);
+#define RTL8169_FREE_RXSKB(skb) 	kfree_skb(skb);
+#define RTL8169_NETIF_RX(skb) 		netif_rx(skb);
+#endif //end #ifdef RTL8169_DEBUG
+
+
+
+
+
+
+//=================================================================
+//	PHYAR
+//	bit		Symbol
+//	31		Flag
+//	30-21	reserved
+//	20-16	5-bit GMII/MII register address
+//	15-0	16-bit GMII/MII register data
+//=================================================================
+void RTL8169_WRITE_GMII_REG( unsigned long ioaddr, int RegAddr, int value )
+{
+	int	i;
+
+	RTL_W32 ( PHYAR, 0x80000000 | (RegAddr&0xFF)<<16 | value);
+	udelay(1000);
+
+	for( i = 2000; i > 0 ; i -- ){
+		// Check if the RTL8169 has completed writing to the specified MII register
+		if( ! (RTL_R32(PHYAR)&0x80000000) ){
+			break;
+		}
+		else{
+			udelay(100);
+		}// end of if( ! (RTL_R32(PHYAR)&0x80000000) )
+	}// end of for() loop
+}
+//=================================================================
+int RTL8169_READ_GMII_REG( unsigned long ioaddr, int RegAddr )
+{
+	int i, value = -1;
+
+	RTL_W32 ( PHYAR, 0x0 | (RegAddr&0xFF)<<16 );
+	udelay(1000);
+
+	for( i = 2000; i > 0 ; i -- ){
+		// Check if the RTL8169 has completed retrieving data from the specified MII register
+		if( RTL_R32(PHYAR) & 0x80000000 ){
+			value = (int)( RTL_R32(PHYAR)&0xFFFF );
+			break;
+		}
+		else{
+			udelay(100);
+		}// end of if( RTL_R32(PHYAR) & 0x80000000 )
+	}// end of for() loop
+	return value;
+}
+
+
+#ifdef RTL8169_IOCTL_SUPPORT
+#include "r8169_ioctl.c"
+#endif //end #ifdef RTL8169_IOCTL_SUPPORT
+
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+#include "r8169_callback.c"
+#endif
+
+
+
+#define rtl8169_request_timer( timer, timer_expires, timer_func, timer_data ) \
+{ \
+	init_timer(timer); \
+	timer->expires = (unsigned long)(jiffies + timer_expires); \
+	timer->data = (unsigned long)(timer_data); \
+	timer->function = (void *)(timer_func); \
+	add_timer(timer); \
+	DBG_PRINT("request_timer at 0x%08lx\n", (unsigned long)timer); \
+}
+
+#define rtl8169_delete_timer( del_timer_t ) \
+{ \
+	del_timer(del_timer_t); \
+	DBG_PRINT("delete_timer at 0x%08lx\n", (unsigned long)del_timer_t); \
+}
+
+#define rtl8169_mod_timer( timer, timer_expires ) \
+{ \
+	mod_timer( timer, jiffies + timer_expires ); \
+}
+
+
+
+
+//======================================================================================================
+//======================================================================================================
+void rtl8169_phy_timer_t_handler( void	*timer_data )
+{
+	struct net_device *dev = (struct net_device *)timer_data;
+	struct rtl8169_private *priv = (struct rtl8169_private *) (dev->priv);
+	unsigned long ioaddr = priv->ioaddr;
+
+	assert( priv->mcfg > MCFG_METHOD_1 );
+	assert( priv->pcfg < PCFG_METHOD_3 );
+
+	if( RTL_R8(PHYstatus) & LinkStatus ){
+		priv->phy_link_down_cnt = 0 ;
+	}
+	else{
+		priv->phy_link_down_cnt ++ ;
+		if( priv->phy_link_down_cnt >= 12 ){
+			// If link on 1000, perform phy reset.
+			if( RTL8169_READ_GMII_REG( ioaddr, PHY_1000_CTRL_REG ) & PHY_Cap_1000_Full )
+			{
+				DBG_PRINT("rtl8169_hw_PHY_reset\n");
+				rtl8169_hw_PHY_reset( dev );
+			}
+
+			priv->phy_link_down_cnt = 0 ;
+		}
+	}
+
+	//---------------------------------------------------------------------------
+	//mod_timer is a more efficient way to update the expire field of an active timer.
+	//---------------------------------------------------------------------------
+//	rtl8169_mod_timer( (&priv->phy_timer_t), 100 );
+}
+
+
+
+//======================================================================================================
+//======================================================================================================
+void rtl8169_timer_handler( void *timer_data )
+{
+	struct net_device *dev = (struct net_device *)timer_data;
+	struct rtl8169_private *priv = (struct rtl8169_private *) (dev->priv);
+
+	if( (priv->mcfg > MCFG_METHOD_1) && (priv->pcfg < PCFG_METHOD_3) ){
+		DBG_PRINT("FIX PCS -> rtl8169_phy_timer_t_handler\n");
+		priv->phy_link_down_cnt = 0;
+		rtl8169_phy_timer_t_handler( timer_data );
+	}
+
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+	{
+		struct r8169_cb_t *rt = &(priv->rt);
+		if( priv->linkstatus == _1000_Full ){
+			r8169_callback(rt);
+		}
+	}
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+
+	rtl8169_mod_timer( (&priv->r8169_timer), priv->expire_time );
+}
+
+
+
+//======================================================================================================
+//======================================================================================================
+static int __devinit rtl8169_init_board ( struct pci_dev *pdev, struct net_device **dev_out, unsigned long *ioaddr_out)
+{
+	unsigned long ioaddr = 0;
+	struct net_device *dev;
+	struct rtl8169_private *priv;
+	int rc, i;
+	unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
+
+
+	assert (pdev != NULL);
+	assert (ioaddr_out != NULL);
+
+	*ioaddr_out = 0;
+	*dev_out = NULL;
+
+	// dev zeroed in init_etherdev
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	dev = init_etherdev (NULL, sizeof (*priv));
+#else
+	dev = alloc_etherdev (sizeof (*priv));
+#endif
+
+	if (dev == NULL) {
+		printk (KERN_ERR PFX "unable to alloc new ethernet\n");
+		return -ENOMEM;
+	}
+
+	SET_MODULE_OWNER(dev);
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
+	SET_NETDEV_DEV(dev, &pdev->dev);
+#endif
+
+	priv = dev->priv;
+
+	// enable device (incl. PCI PM wakeup and hotplug setup)
+	rc = pci_enable_device (pdev);
+	if (rc)
+		goto err_out;
+
+	mmio_start = pci_resource_start (pdev, 1);
+	mmio_end = pci_resource_end (pdev, 1);
+	mmio_flags = pci_resource_flags (pdev, 1);
+	mmio_len = pci_resource_len (pdev, 1);
+
+	// make sure PCI base addr 1 is MMIO
+	if (!(mmio_flags & IORESOURCE_MEM)) {
+		printk (KERN_ERR PFX "region #1 not an MMIO resource, aborting\n");
+		rc = -ENODEV;
+		goto err_out;
+	}
+
+	// check for weird/broken PCI region reporting
+	if ( mmio_len < RTL_MIN_IO_SIZE ) {
+		printk (KERN_ERR PFX "Invalid PCI region size(s), aborting\n");
+		rc = -ENODEV;
+		goto err_out;
+	}
+
+
+	rc = pci_request_regions (pdev, dev->name);
+	if (rc)
+		goto err_out;
+
+	// enable PCI bus-mastering
+	pci_set_master (pdev);
+
+#ifdef RTL8169_USE_IO
+	ioaddr = pci_resource_start(pdev, 0);
+#else
+	// ioremap MMIO region
+	ioaddr = (unsigned long)ioremap (mmio_start, mmio_len);
+	if (ioaddr == 0) {
+		printk (KERN_ERR PFX "cannot remap MMIO, aborting\n");
+		rc = -EIO;
+		goto err_out_free_res;
+	}
+#endif
+
+	// Soft reset the chip.
+	RTL_W8 ( ChipCmd, CmdReset);
+
+	// Check that the chip has finished the reset.
+	for (i = 1000; i > 0; i--){
+		if ( (RTL_R8(ChipCmd) & CmdReset) == 0){
+			break;
+		}
+		else{
+			udelay (10);
+		}
+	}
+
+	// identify config method
+	{
+		unsigned long val32 = (RTL_R32(TxConfig)&0x7c800000);
+
+		if( val32 == (0x1<<28) ){
+			priv->mcfg = MCFG_METHOD_4;
+		}
+		else if( val32 == (0x1<<26) ){
+			priv->mcfg = MCFG_METHOD_3;
+		}
+		else if( val32 == (0x1<<23) ){
+			priv->mcfg = MCFG_METHOD_2;
+		}
+		else if( val32 == 0x00000000 ){
+			priv->mcfg = MCFG_METHOD_1;
+		}
+		else{
+			priv->mcfg = MCFG_METHOD_1;
+		}
+	}
+	{
+		unsigned char val8 = (unsigned char)(RTL8169_READ_GMII_REG(ioaddr,3)&0x000f);
+		if( val8 == 0x00 ){
+			priv->pcfg = PCFG_METHOD_1;
+		}
+		else if( val8 == 0x01 ){
+			priv->pcfg = PCFG_METHOD_2;
+		}
+		else if( val8 == 0x02 ){
+			priv->pcfg = PCFG_METHOD_3;
+		}
+		else{
+			priv->pcfg = PCFG_METHOD_3;
+		}
+	}
+
+
+	for (i = ARRAY_SIZE (rtl_chip_info) - 1; i >= 0; i--){
+		if (priv->mcfg == rtl_chip_info[i].mcfg) {
+			priv->chipset = i;
+			goto match;
+		}
+	}
+
+	//if unknown chip, assume array element #0, original RTL-8169 in this case
+	//printk (KERN_DEBUG PFX "PCI device %s: unknown chip version, assuming RTL-8169\n", pdev->slot_name);
+	priv->chipset = 0;
+
+match:
+	*ioaddr_out = ioaddr;
+	*dev_out = dev;
+	return 0;
+
+#ifndef RTL8169_USE_IO
+err_out_free_res:
+	pci_release_regions (pdev);
+#endif
+
+err_out:
+	unregister_netdev (dev);
+	kfree (dev);
+	return rc;
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static int __devinit rtl8169_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+{
+	struct net_device *dev = NULL;
+	struct rtl8169_private *priv = NULL;
+	unsigned long ioaddr = 0;
+	static int board_idx = -1;
+	int i;
+	int option = -1, Cap10_100 = 0, Cap1000 = 0;
+
+
+	assert (pdev != NULL);
+	assert (ent != NULL);
+
+	board_idx++;
+
+
+	i = rtl8169_init_board (pdev, &dev, &ioaddr);
+	if (i < 0) {
+		return i;
+	}
+
+	priv = dev->priv;
+
+	assert (ioaddr != NULL);
+	assert (dev != NULL);
+	assert (priv != NULL);
+
+	// Get MAC address //
+	for (i = 0; i < MAC_ADDR_LEN ; i++){
+		dev->dev_addr[i] = RTL_R8( MAC0 + i );
+	}
+
+	dev->open		= rtl8169_open;
+	dev->hard_start_xmit 	= rtl8169_start_xmit;
+	dev->get_stats    	= rtl8169_get_stats;
+	dev->stop 		= rtl8169_close;
+	dev->tx_timeout 	= rtl8169_tx_timeout;
+	dev->set_multicast_list = rtl8169_set_rx_mode;
+	dev->watchdog_timeo 	= TX_TIMEOUT;
+	dev->irq 		= pdev->irq;
+	dev->base_addr 		= (unsigned long) ioaddr;
+
+#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+	dev->change_mtu		= rtl8169_change_mtu;
+#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+#ifdef RTL8169_IOCTL_SUPPORT
+	dev->do_ioctl 		= rtl8169_ioctl;
+#endif //end #ifdef RTL8169_IOCTL_SUPPORT
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+	priv->rt.dev = dev;
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+	priv = dev->priv;				// private data //
+	priv->pci_dev 	= pdev;
+	priv->ioaddr 	= ioaddr;
+
+//#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+	priv->curr_mtu_size = dev->mtu;
+	priv->tx_pkt_len = dev->mtu + ETH_HDR_LEN;
+	priv->rx_pkt_len = dev->mtu + ETH_HDR_LEN;
+	priv->hw_rx_pkt_len = priv->rx_pkt_len + 8;
+//#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+	DBG_PRINT("-------------------------- \n");
+	DBG_PRINT("dev->mtu = %d \n", dev->mtu);
+	DBG_PRINT("priv->curr_mtu_size = %d \n", priv->curr_mtu_size);
+	DBG_PRINT("priv->tx_pkt_len = %d \n", priv->tx_pkt_len);
+	DBG_PRINT("priv->rx_pkt_len = %d \n", priv->rx_pkt_len);
+	DBG_PRINT("priv->hw_rx_pkt_len = %d \n", priv->hw_rx_pkt_len);
+	DBG_PRINT("-------------------------- \n");
+
+	spin_lock_init (&priv->lock);
+
+	register_netdev (dev);
+
+	pci_set_drvdata(pdev, dev);     //      pdev->driver_data = data;
+
+
+	printk (KERN_DEBUG "%s: Identified chip type is '%s'.\n",dev->name,rtl_chip_info[priv->chipset].name);
+	printk (KERN_INFO "%s: %s at 0x%lx, "
+				"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
+				"IRQ %d\n",
+				dev->name,
+				RTL8169_DRIVER_NAME,
+				dev->base_addr,
+				dev->dev_addr[0], dev->dev_addr[1],
+				dev->dev_addr[2], dev->dev_addr[3],
+				dev->dev_addr[4], dev->dev_addr[5],
+				dev->irq);
+
+
+	// Config PHY
+	rtl8169_hw_PHY_config(dev);
+
+	DBG_PRINT("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
+	RTL_W8( 0x82, 0x01 );
+
+	if( priv->mcfg < MCFG_METHOD_3 ){
+		DBG_PRINT("Set PCI Latency=0x40\n");
+		pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
+	}
+
+	if( priv->mcfg == MCFG_METHOD_2 ){
+		DBG_PRINT("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
+		RTL_W8( 0x82, 0x01 );
+		DBG_PRINT("Set PHY Reg 0x0bh = 0x00h\n");
+		RTL8169_WRITE_GMII_REG( ioaddr, 0x0b, 0x0000 );	//w 0x0b 15 0 0
+	}
+
+	// if TBI is not endbled
+	if( !(RTL_R8(PHYstatus) & TBI_Enable) ){
+		int	val = RTL8169_READ_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG );
+
+#ifdef RTL8169_HW_FLOW_CONTROL_SUPPORT
+		val |= PHY_Cap_PAUSE | PHY_Cap_ASYM_PAUSE ;
+#endif //end #define RTL8169_HW_FLOW_CONTROL_SUPPORT
+
+		option = (board_idx >= MAX_UNITS) ? 0 : media[board_idx];
+		// Force RTL8169 in 10/100/1000 Full/Half mode.
+		if( option > 0 ){
+			printk(KERN_INFO "%s: Force-mode Enabled. \n", dev->name);
+			Cap10_100 = 0;
+			Cap1000 = 0;
+			switch( option ){
+				case _10_Half:
+						Cap10_100 = PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_Null;
+						break;
+				case _10_Full:
+						Cap10_100 = PHY_Cap_10_Full | PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_Null;
+						break;
+				case _100_Half:
+						Cap10_100 = PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_Null;
+						break;
+				case _100_Full:
+						Cap10_100 = PHY_Cap_100_Full | PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_Null;
+						break;
+				case _1000_Full:
+						Cap10_100 = PHY_Cap_100_Full | PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half;
+						Cap1000 = PHY_Cap_1000_Full;
+						break;
+				default:
+						break;
+			}
+			RTL8169_WRITE_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG, Cap10_100 | ( val&0xC1F ) );	//leave PHY_AUTO_NEGO_REG bit4:0 unchanged
+			RTL8169_WRITE_GMII_REG( ioaddr, PHY_1000_CTRL_REG, Cap1000 );
+		}
+		else{
+			printk(KERN_INFO "%s: Auto-negotiation Enabled.\n", dev->name);
+
+			// enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged
+			RTL8169_WRITE_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG,
+				PHY_Cap_10_Half | PHY_Cap_10_Full | PHY_Cap_100_Half | PHY_Cap_100_Full | ( val&0xC1F ) );
+
+			// enable 1000 Full Mode
+			RTL8169_WRITE_GMII_REG( ioaddr, PHY_1000_CTRL_REG, PHY_Cap_1000_Full );
+
+		}// end of if( option > 0 )
+
+
+		// Enable auto-negotiation and restart auto-nigotiation
+		RTL8169_WRITE_GMII_REG( ioaddr, PHY_CTRL_REG, PHY_Enable_Auto_Nego | PHY_Restart_Auto_Nego );
+		udelay(100);
+
+		// wait for auto-negotiation process
+		for( i = 10000; i > 0; i-- ){
+			//check if auto-negotiation complete
+			if( RTL8169_READ_GMII_REG(ioaddr, PHY_STAT_REG) & PHY_Auto_Neco_Comp ){
+				udelay(100);
+				option = RTL_R8(PHYstatus);
+				if( option & _1000bpsF ){
+					printk(KERN_INFO "%s: 1000Mbps Full-duplex operation.\n", dev->name);
+				}
+				else{
+					printk(KERN_INFO "%s: %sMbps %s-duplex operation.\n", dev->name,
+							(option & _100bps) ? "100" : "10", (option & FullDup) ? "Full" : "Half" );
+				}
+				break;
+			}
+			else{
+				udelay(100);
+			}// end of if( RTL8169_READ_GMII_REG(ioaddr, 1) & 0x20 )
+		}// end for-loop to wait for auto-negotiation process
+
+		option = RTL_R8(PHYstatus);
+		if( option & _1000bpsF ){
+			priv->linkstatus = _1000_Full;
+		}
+		else{
+			if(option & _100bps){
+				priv->linkstatus = (option & FullDup) ? _100_Full : _100_Half;
+			}
+            else{
+				priv->linkstatus = (option & FullDup) ? _10_Full : _10_Half;
+			}
+		}
+		DBG_PRINT("priv->linkstatus = 0x%02x\n", priv->linkstatus);
+
+	}// end of TBI is not enabled
+	else{
+		udelay(100);
+		DBG_PRINT("1000Mbps Full-duplex operation, TBI Link %s!\n",(RTL_R32(TBICSR) & TBILinkOK) ? "OK" : "Failed" );
+
+	}// end of TBI is not enabled
+
+	return 0;
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static void __devexit rtl8169_remove_one (struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata(pdev);
+
+	assert (dev != NULL);
+	assert (priv != NULL);
+
+	unregister_netdev (dev);
+
+#ifdef RTL8169_USE_IO
+#else
+	iounmap ((void *)(dev->base_addr));
+#endif
+	pci_release_regions (pdev);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	kfree (dev);
+#else
+	free_netdev(dev);
+#endif
+
+	pci_set_drvdata (pdev, NULL);
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static int rtl8169_open (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	struct pci_dev *pdev = priv->pci_dev;
+	int retval;
+//	u8 diff;
+//	u32 TxPhyAddr, RxPhyAddr;
+
+
+	if( priv->drvinit_fail == 1 ){
+		printk("%s: Gigabit driver open failed.\n", dev->name );
+		return -ENOMEM;
+	}
+
+	retval = request_irq (dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev);
+	if (retval) {
+		return retval;
+	}
+
+	//2004-05-11
+	// Allocate tx/rx descriptor space
+	priv->sizeof_txdesc_space = NUM_TX_DESC * sizeof(struct TxDesc)+256;
+	priv->txdesc_space = pci_alloc_consistent( pdev, priv->sizeof_txdesc_space, &priv->txdesc_phy_dma_addr );
+	if( priv->txdesc_space == NULL ){
+		printk("%s: Gigabit driver alloc txdesc_space failed.\n", dev->name );
+		return -ENOMEM;
+	}
+	priv->sizeof_rxdesc_space = NUM_RX_DESC * sizeof(struct RxDesc)+256;
+	priv->rxdesc_space = pci_alloc_consistent( pdev, priv->sizeof_rxdesc_space, &priv->rxdesc_phy_dma_addr );
+	if( priv->rxdesc_space == NULL ){
+		printk("%s: Gigabit driver alloc rxdesc_space failed.\n", dev->name );
+		return -ENOMEM;
+	}
+
+	if(priv->txdesc_phy_dma_addr & 0xff){
+		printk("%s: Gigabit driver txdesc_phy_dma_addr is not 256-bytes-aligned.\n", dev->name );
+	}
+	if(priv->rxdesc_phy_dma_addr & 0xff){
+		printk("%s: Gigabit driver rxdesc_phy_dma_addr is not 256-bytes-aligned.\n", dev->name );
+	}
+	// Set tx/rx descriptor space
+	priv->TxDescArray = (struct TxDesc *)priv->txdesc_space;
+	priv->RxDescArray = (struct RxDesc *)priv->rxdesc_space;
+
+	{
+		int i;
+		struct sk_buff *skb = NULL;
+
+		for(i=0;i<NUM_RX_DESC;i++){
+			skb = RTL8169_ALLOC_RXSKB(MAX_RX_SKBDATA_SIZE);
+			if( skb != NULL ) {
+				skb_reserve (skb, 2);	// 16 byte align the IP fields. //
+				priv->Rx_skbuff[i] = skb;
+			}
+			else{
+				printk("%s: Gigabit driver failed to allocate skbuff.\n", dev->name);
+				priv->drvinit_fail = 1;
+			}
+		}
+	}
+
+
+	//////////////////////////////////////////////////////////////////////////////
+	rtl8169_init_ring (dev);
+	rtl8169_hw_start (dev);
+
+
+	// ------------------------------------------------------
+	DBG_PRINT("FIX PCS -> rtl8169_request_timer\n");
+	priv->expire_time = RTL8169_TIMER_EXPIRE_TIME;
+	rtl8169_request_timer( (&priv->r8169_timer), priv->expire_time, rtl8169_timer_handler, ((void *)dev) );  //in open()
+
+
+	DBG_PRINT("%s: %s() alloc_rxskb_cnt = %d\n", dev->name, __FUNCTION__, alloc_rxskb_cnt );
+
+	return 0;
+
+}//end of rtl8169_open (struct net_device *dev)
+
+
+
+
+
+
+
+
+//======================================================================================================
+static void rtl8169_hw_PHY_reset(struct net_device *dev)
+{
+	int val, phy_reset_expiretime = 50;
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+
+	DBG_PRINT("%s: Reset RTL8169s PHY\n", dev->name);
+
+	val = ( RTL8169_READ_GMII_REG( ioaddr, 0 ) | 0x8000 ) & 0xffff;
+	RTL8169_WRITE_GMII_REG( ioaddr, 0, val );
+
+	do //waiting for phy reset
+	{
+		if( RTL8169_READ_GMII_REG( ioaddr, 0 ) & 0x8000 ){
+			phy_reset_expiretime --;
+			udelay(100);
+		}
+		else{
+			break;
+		}
+	}while( phy_reset_expiretime >= 0 );
+
+	assert( phy_reset_expiretime > 0 );
+}
+
+
+
+
+//======================================================================================================
+static void rtl8169_hw_PHY_config (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	void *ioaddr = (void*)priv->ioaddr;
+
+	DBG_PRINT("priv->mcfg=%d, priv->pcfg=%d\n",priv->mcfg,priv->pcfg);
+
+	if( priv->mcfg == MCFG_METHOD_4 ){
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0001 );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x09, 0x273a );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x0e, 0x7bfb );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1b, 0x841e );
+
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0002 );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x01, 0x90D0 );
+		RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0000 );
+	}
+	else{
+		DBG_PRINT("priv->mcfg=%d. Discard hw PHY config.\n",priv->mcfg);
+	}
+}
+
+
+
+
+
+
+
+
+
+
+//======================================================================================================
+static void rtl8169_hw_start (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	u32 i;
+
+
+	/* Soft reset the chip. */
+	RTL_W8 ( ChipCmd, CmdReset);
+
+	/* Check that the chip has finished the reset. */
+	for (i = 1000; i > 0; i--){
+		if ((RTL_R8( ChipCmd ) & CmdReset) == 0) break;
+		else udelay (10);
+	}
+
+	RTL_W8 ( Cfg9346, Cfg9346_Unlock);
+	RTL_W8 ( ChipCmd, CmdTxEnb | CmdRxEnb);
+	RTL_W8 ( ETThReg, ETTh);
+
+	// For gigabit rtl8169
+	RTL_W16	( RxMaxSize, (unsigned short)priv->hw_rx_pkt_len );
+
+	// Set Rx Config register
+	i = rtl8169_rx_config | ( RTL_R32( RxConfig ) & rtl_chip_info[priv->chipset].RxConfigMask);
+	RTL_W32 ( RxConfig, i);
+
+
+	/* Set DMA burst size and Interframe Gap Time */
+	RTL_W32 ( TxConfig, (TX_DMA_BURST << TxDMAShift) | (InterFrameGap << TxInterFrameGapShift) );
+
+
+
+	RTL_W16( CPlusCmd, RTL_R16(CPlusCmd) );
+
+	if(	priv->mcfg == MCFG_METHOD_2 ||
+		priv->mcfg == MCFG_METHOD_3)
+	{
+		RTL_W16( CPlusCmd, (RTL_R16(CPlusCmd)|(1<<14)|(1<<3)) );
+		DBG_PRINT("Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14\n");
+	}
+	else
+	{
+		RTL_W16( CPlusCmd, (RTL_R16(CPlusCmd)|(1<<3)) );
+		DBG_PRINT("Set MAC Reg C+CR Offset 0xE0: bit-3.\n");
+	}
+
+	{
+		//RTL_W16(0xE2, 0x1517);
+		//RTL_W16(0xE2, 0x152a);
+		//RTL_W16(0xE2, 0x282a);
+		RTL_W16(0xE2, 0x0000);
+	}
+
+	priv->cur_rx = 0;
+
+	RTL_W32 ( TxDescStartAddr, priv->txdesc_phy_dma_addr);
+	RTL_W32 ( TxDescStartAddr + 4, 0x00);
+	RTL_W32 ( RxDescStartAddr, priv->rxdesc_phy_dma_addr);
+	RTL_W32 ( RxDescStartAddr + 4, 0x00);
+
+	RTL_W8 ( Cfg9346, Cfg9346_Lock );
+	udelay (10);
+
+	RTL_W32 ( RxMissed, 0 );
+
+	rtl8169_set_rx_mode (dev);
+
+	RTL_W16 ( MultiIntr, RTL_R16(MultiIntr) & 0xF000);
+
+	RTL_W16 ( IntrMask, rtl8169_intr_mask);
+
+	netif_start_queue (dev);
+
+}//end of rtl8169_hw_start (struct net_device *dev)
+
+
+
+
+
+
+
+//======================================================================================================
+static void rtl8169_init_ring (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	struct pci_dev *pdev = priv->pci_dev;
+	int i;
+	struct sk_buff	*skb;
+	
+
+	priv->cur_rx = 0;
+	priv->cur_tx = 0;
+	priv->dirty_tx = 0;
+	memset(priv->TxDescArray, 0x0, NUM_TX_DESC*sizeof(struct TxDesc));
+	memset(priv->RxDescArray, 0x0, NUM_RX_DESC*sizeof(struct RxDesc));
+
+
+	for (i=0 ; i<NUM_TX_DESC ; i++){
+		priv->Tx_skbuff[i]=NULL;
+		priv->txdesc_array_dma_addr[i] = pci_map_single(pdev, &priv->TxDescArray[i], sizeof(struct TxDesc), PCI_DMA_TODEVICE);
+	}
+
+	for (i=0; i <NUM_RX_DESC; i++) {
+		if(i==(NUM_RX_DESC-1)){
+			priv->RxDescArray[i].status = cpu_to_le32((OWNbit | EORbit) | (unsigned long)priv->hw_rx_pkt_len);
+		}
+		else{
+			priv->RxDescArray[i].status = cpu_to_le32(OWNbit | (unsigned long)priv->hw_rx_pkt_len);
+		}
+
+		{//-----------------------------------------------------------------------
+			skb = priv->Rx_skbuff[i];
+			priv->rx_skbuff_dma_addr[i] = pci_map_single(pdev, skb->data, MAX_RX_SKBDATA_SIZE, PCI_DMA_FROMDEVICE);
+
+			if( skb != NULL ){
+				priv->RxDescArray[i].buf_addr = cpu_to_le32(priv->rx_skbuff_dma_addr[i]);
+				priv->RxDescArray[i].buf_Haddr = 0;
+			}
+			else{
+				DBG_PRINT("%s: %s() Rx_skbuff == NULL\n", dev->name, __FUNCTION__);
+				priv->drvinit_fail = 1;
+			}
+		}//-----------------------------------------------------------------------
+		priv->rxdesc_array_dma_addr[i] = pci_map_single(pdev, &priv->RxDescArray[i], sizeof(struct RxDesc), PCI_DMA_TODEVICE);
+		pci_dma_sync_single_for_device(pdev, priv->rxdesc_array_dma_addr[i], sizeof(struct RxDesc), PCI_DMA_TODEVICE);
+	}
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static void rtl8169_tx_clear (struct rtl8169_private *priv)
+{
+	int i;
+
+	priv->cur_tx = 0;
+	for ( i = 0 ; i < NUM_TX_DESC ; i++ ){
+		if ( priv->Tx_skbuff[i] != NULL ) {
+			dev_kfree_skb ( priv->Tx_skbuff[i] );
+			priv->Tx_skbuff[i] = NULL;
+			priv->stats.tx_dropped++;
+		}
+	}
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static void rtl8169_tx_timeout (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	u8 tmp8;
+
+	/* disable Tx, if not already */
+	tmp8 = RTL_R8( ChipCmd );
+	if (tmp8 & CmdTxEnb){
+		RTL_W8 ( ChipCmd, tmp8 & ~CmdTxEnb);
+	}
+
+	/* Disable interrupts by clearing the interrupt mask. */
+	RTL_W16 ( IntrMask, 0x0000);
+
+	/* Stop a shared interrupt from scavenging while we are. */
+	spin_lock_irq (&priv->lock);
+	rtl8169_tx_clear (priv);
+	spin_unlock_irq (&priv->lock);
+
+
+	rtl8169_hw_start (dev);
+
+	netif_wake_queue (dev);
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static int rtl8169_start_xmit (struct sk_buff *skb, struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	struct pci_dev *pdev = priv->pci_dev;
+	int entry = priv->cur_tx % NUM_TX_DESC;
+	int buf_len = 60;
+	dma_addr_t txbuf_dma_addr;
+
+	spin_lock_irq (&priv->lock);
+
+	if( (le32_to_cpu(priv->TxDescArray[entry].status) & OWNbit)==0 ){
+
+		priv->Tx_skbuff[entry] = skb;
+		txbuf_dma_addr = pci_map_single(pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
+		
+		priv->TxDescArray[entry].buf_addr = cpu_to_le32(txbuf_dma_addr);
+		DBG_PRINT("%s: TX pkt_size = %d\n", __FUNCTION__, skb->len);
+		if( skb->len <= priv->tx_pkt_len ){
+			buf_len = skb->len;
+		}
+		else{
+			printk("%s: Error -- Tx packet size(%d) > mtu(%d)+14\n", dev->name, skb->len, dev->mtu);
+			buf_len = priv->tx_pkt_len;
+		}
+
+		if( entry != (NUM_TX_DESC-1) ){
+			priv->TxDescArray[entry].status = cpu_to_le32((OWNbit | FSbit | LSbit) | buf_len);
+		}
+		else{
+			priv->TxDescArray[entry].status = cpu_to_le32((OWNbit | EORbit | FSbit | LSbit) | buf_len);
+		}
+
+		pci_dma_sync_single_for_device(pdev, priv->txdesc_array_dma_addr[entry], sizeof(struct TxDesc), PCI_DMA_TODEVICE);
+
+		RTL_W8 ( TxPoll, 0x40);		//set polling bit
+
+		dev->trans_start = jiffies;
+
+		priv->stats.tx_bytes += ( (skb->len > ETH_ZLEN) ? skb->len : ETH_ZLEN);
+		priv->cur_tx++;
+	}//end of if( (priv->TxDescArray[entry].status & 0x80000000)==0 )
+
+	spin_unlock_irq (&priv->lock);
+
+	if ( (priv->cur_tx - NUM_TX_DESC) == priv->dirty_tx ){
+		netif_stop_queue (dev);
+	}
+	else{
+		if (netif_queue_stopped (dev)){
+			netif_wake_queue (dev);
+		}
+	}
+
+	return 0;
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static void rtl8169_tx_interrupt (struct net_device *dev, struct rtl8169_private *priv, unsigned long ioaddr)
+{
+	unsigned long dirty_tx, tx_left=0;
+	int entry = priv->cur_tx % NUM_TX_DESC;
+    	int txloop_cnt = 0;
+
+	assert (dev != NULL);
+	assert (priv != NULL);
+	assert (ioaddr != NULL);
+
+
+	dirty_tx = priv->dirty_tx;
+	tx_left = priv->cur_tx - dirty_tx;
+
+	while( (tx_left > 0) && (txloop_cnt < max_interrupt_work) ){
+		if( (le32_to_cpu(priv->TxDescArray[entry].status) & OWNbit) == 0 ){
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+			r8169_callback_tx(&(priv->rt), 1, priv->Tx_skbuff[dirty_tx % NUM_TX_DESC]->len);
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+			dev_kfree_skb_irq( priv->Tx_skbuff[dirty_tx % NUM_TX_DESC] );
+			priv->Tx_skbuff[dirty_tx % NUM_TX_DESC] = NULL;
+			priv->stats.tx_packets++;
+			dirty_tx++;
+			tx_left--;
+			entry++;
+		}
+		txloop_cnt ++;
+	}
+
+	if (priv->dirty_tx != dirty_tx) {
+		priv->dirty_tx = dirty_tx;
+		if (netif_queue_stopped (dev))
+			netif_wake_queue (dev);
+	}
+}
+
+
+
+
+
+
+//======================================================================================================
+static void rtl8169_rx_interrupt (struct net_device *dev, struct rtl8169_private *priv, unsigned long ioaddr)
+{
+	struct pci_dev *pdev = priv->pci_dev;
+	int cur_rx;
+	int pkt_size = 0 ;
+	int rxdesc_cnt = 0;
+	int ret;
+	struct sk_buff *n_skb = NULL;
+	struct sk_buff *cur_skb;
+	struct sk_buff *rx_skb;
+	struct	RxDesc	*rxdesc;
+
+	assert (dev != NULL);
+	assert (priv != NULL);
+	assert (ioaddr != NULL);
+
+
+	cur_rx = priv->cur_rx;
+
+	rxdesc = &priv->RxDescArray[cur_rx];
+	pci_dma_sync_single_for_device(pdev, priv->rxdesc_array_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE);
+
+	while ( ((le32_to_cpu(rxdesc->status) & OWNbit)== 0) && (rxdesc_cnt < max_interrupt_work) ){
+
+	    rxdesc_cnt++;
+
+	    if( le32_to_cpu(rxdesc->status) & RxRES ){
+			printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name);
+			priv->stats.rx_errors++;
+			if ( le32_to_cpu(rxdesc->status) & (RxRWT|RxRUNT) )
+				priv->stats.rx_length_errors++;
+			if ( le32_to_cpu(rxdesc->status) & RxCRC)
+				priv->stats.rx_crc_errors++;
+	    }
+	    else{
+			pkt_size=(int)(le32_to_cpu(rxdesc->status) & 0x00001FFF)-4;
+
+			if( pkt_size > priv->rx_pkt_len ){
+				printk("%s: Error -- Rx packet size(%d) > mtu(%d)+14\n", dev->name, pkt_size, dev->mtu);
+				pkt_size = priv->rx_pkt_len;
+			}
+
+			DBG_PRINT("%s: RX pkt_size = %d\n", __FUNCTION__, pkt_size);
+
+			{// -----------------------------------------------------
+				rx_skb = priv->Rx_skbuff[cur_rx];
+				n_skb = RTL8169_ALLOC_RXSKB(MAX_RX_SKBDATA_SIZE);
+				if( n_skb != NULL ) {
+					skb_reserve (n_skb, 2);	// 16 byte align the IP fields. //
+
+					// Indicate rx_skb
+					if( rx_skb != NULL ){
+						rx_skb->dev = dev;
+						pci_dma_sync_single_for_device(pdev, priv->rx_skbuff_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE);
+
+						skb_put ( rx_skb, pkt_size );
+						rx_skb->protocol = eth_type_trans ( rx_skb, dev );
+						ret = RTL8169_NETIF_RX (rx_skb);
+
+//						dev->last_rx = jiffies;
+						priv->stats.rx_bytes += pkt_size;
+						priv->stats.rx_packets++;
+
+#ifdef RTL8169_DYNAMIC_CONTROL
+						r8169_callback_rx( &(priv->rt), 1, pkt_size);
+#endif //end #ifdef RTL8169_DYNAMIC_CONTROL
+
+					}//end if( rx_skb != NULL )
+
+					priv->Rx_skbuff[cur_rx] = n_skb;
+				}
+				else{
+					DBG_PRINT("%s: Allocate n_skb failed!\n",__FUNCTION__ );
+					priv->Rx_skbuff[cur_rx] = rx_skb;
+				}
+
+
+				// Update rx descriptor
+				if( cur_rx == (NUM_RX_DESC-1) ){
+					priv->RxDescArray[cur_rx].status  = cpu_to_le32((OWNbit | EORbit) | (unsigned long)priv->hw_rx_pkt_len);
+				}
+				else{
+					priv->RxDescArray[cur_rx].status  = cpu_to_le32(OWNbit | (unsigned long)priv->hw_rx_pkt_len);
+				}
+
+				cur_skb = priv->Rx_skbuff[cur_rx];
+
+				if( cur_skb != NULL ){
+					priv->rx_skbuff_dma_addr[cur_rx] = pci_map_single(pdev, cur_skb->data, MAX_RX_SKBDATA_SIZE, PCI_DMA_FROMDEVICE);
+					rxdesc->buf_addr = cpu_to_le32(priv->rx_skbuff_dma_addr[cur_rx]);
+				}
+				else{
+					DBG_PRINT("%s: %s() cur_skb == NULL\n", dev->name, __FUNCTION__);
+				}
+
+			}//------------------------------------------------------------
+
+	    }// end of if( priv->RxDescArray[cur_rx].status & RxRES )
+
+	    cur_rx = (cur_rx +1) % NUM_RX_DESC;
+	    rxdesc = &priv->RxDescArray[cur_rx];
+	    pci_dma_sync_single_for_device(pdev, priv->rxdesc_array_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE);
+
+	}// end of while ( (priv->RxDescArray[cur_rx].status & 0x80000000)== 0)
+
+	if( rxdesc_cnt >= max_interrupt_work ){
+		DBG_PRINT("%s: Too much work at Rx interrupt.\n", dev->name);
+	}
+
+	priv->cur_rx = cur_rx;
+}
+
+
+
+
+
+
+
+
+//======================================================================================================
+/* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+static void rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+#else
+static irqreturn_t rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+#endif
+{
+	struct net_device *dev = (struct net_device *) dev_instance;
+	struct rtl8169_private *priv = dev->priv;
+	int boguscnt = max_interrupt_work;
+	unsigned long ioaddr = priv->ioaddr;
+	int status = 0;
+	irqreturn_t interrupt_handled = IRQ_NONE;
+
+	RTL_W16 ( IntrMask, 0x0000);
+
+	do {
+		status = RTL_R16(IntrStatus);
+
+		if (status == 0xFFFF)
+			break;
+
+
+		RTL_W16( IntrStatus, status );
+
+
+		if ( (status & rtl8169_intr_mask ) == 0 )
+			break;
+		else
+			interrupt_handled = IRQ_HANDLED;
+
+
+		// Rx interrupt
+//		if (status & (RxOK | RxErr /* | LinkChg | RxOverflow | RxFIFOOver*/)){
+			rtl8169_rx_interrupt (dev, priv, ioaddr);
+//		}
+
+		// Tx interrupt
+//		if (status & (TxOK | TxErr)) {
+			spin_lock (&priv->lock);
+			rtl8169_tx_interrupt (dev, priv, ioaddr);
+			spin_unlock (&priv->lock);
+//		}
+
+		boguscnt--;
+	} while (boguscnt > 0);
+
+	if (boguscnt <= 0) {
+		DBG_PRINT("%s: Too much work at interrupt!\n", dev->name);
+		RTL_W16( IntrStatus, 0xffff);	// Clear all interrupt sources
+	}
+
+	RTL_W16 ( IntrMask, rtl8169_intr_mask);
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
+	return interrupt_handled;
+#endif
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static int rtl8169_close (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	int i;
+
+	// -----------------------------------------
+	rtl8169_delete_timer( &(priv->r8169_timer) );
+
+
+	netif_stop_queue (dev);
+
+	spin_lock_irq (&priv->lock);
+
+	/* Stop the chip's Tx and Rx processes. */
+	RTL_W8 ( ChipCmd, 0x00);
+
+	/* Disable interrupts by clearing the interrupt mask. */
+	RTL_W16 ( IntrMask, 0x0000);
+
+	/* Update the error counts. */
+	priv->stats.rx_missed_errors += RTL_R32(RxMissed);
+	RTL_W32( RxMissed, 0);
+
+	spin_unlock_irq (&priv->lock);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	synchronize_irq ();
+#else
+	synchronize_irq (dev->irq);
+#endif
+	free_irq (dev->irq, dev);
+
+	rtl8169_tx_clear (priv);
+	
+	//2004-05-11
+	if(priv->txdesc_space != NULL){
+		pci_free_consistent(
+				priv->pci_dev,
+				priv->sizeof_txdesc_space,
+				priv->txdesc_space,
+				priv->txdesc_phy_dma_addr
+		);
+		priv->txdesc_space = NULL;
+	}
+
+	if(priv->rxdesc_space != NULL){
+		pci_free_consistent(
+				priv->pci_dev,
+				priv->sizeof_rxdesc_space,
+				priv->rxdesc_space,
+				priv->rxdesc_phy_dma_addr
+		);
+		priv->rxdesc_space = NULL;
+	}
+
+	priv->TxDescArray = NULL;
+	priv->RxDescArray = NULL;
+
+	{//-----------------------------------------------------------------------------
+		for(i=0;i<NUM_RX_DESC;i++){
+			if( priv->Rx_skbuff[i] != NULL ) {
+				RTL8169_FREE_RXSKB ( priv->Rx_skbuff[i] );
+			}
+		}
+	}//-----------------------------------------------------------------------------
+
+	DBG_PRINT("%s: %s() alloc_rxskb_cnt = %d\n", dev->name, __FUNCTION__, alloc_rxskb_cnt );
+
+	return 0;
+}
+
+
+
+
+
+
+
+//======================================================================================================
+static unsigned const ethernet_polynomial = 0x04c11db7U;
+static inline u32 ether_crc (int length, unsigned char *data)
+{
+	int crc = -1;
+
+	while (--length >= 0) {
+		unsigned char current_octet = *data++;
+		int bit;
+		for (bit = 0; bit < 8; bit++, current_octet >>= 1)
+			crc = (crc << 1) ^ ((crc < 0) ^ (current_octet & 1) ? ethernet_polynomial : 0);
+	}
+
+	return crc;
+}
+
+
+
+
+
+
+
+
+//======================================================================================================
+static void rtl8169_set_rx_mode (struct net_device *dev)
+{
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+	unsigned long flags;
+	u32 mc_filter[2];	/* Multicast hash filter */
+	int i, rx_mode;
+	u32 tmp=0;
+	
+
+	if (dev->flags & IFF_PROMISC) {
+		/* Unconditionally log net taps. */
+		printk (KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
+		rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptAllPhys;
+		mc_filter[1] = mc_filter[0] = 0xffffffff;
+	} else if ((dev->mc_count > multicast_filter_limit) || (dev->flags & IFF_ALLMULTI)) {
+		/* Too many to filter perfectly -- accept all multicasts. */
+		rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
+		mc_filter[1] = mc_filter[0] = 0xffffffff;
+	} else {
+		struct dev_mc_list *mclist;
+		rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
+		mc_filter[1] = mc_filter[0] = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next)
+		{
+			set_bit (ether_crc (ETH_ALEN, mclist->dmi_addr) >> 26, mc_filter);
+		}			
+#else
+		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next)
+		{
+			int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
+			                                                                                                     
+			mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
+			rx_mode |= AcceptMulticast;
+		}
+#endif		
+	}
+
+	spin_lock_irqsave (&priv->lock, flags);
+
+	tmp = rtl8169_rx_config | rx_mode | (RTL_R32(RxConfig) & rtl_chip_info[priv->chipset].RxConfigMask);
+
+	RTL_W32 ( RxConfig, tmp);
+	RTL_W32 ( MAR0 + 0, mc_filter[0]);
+	RTL_W32 ( MAR0 + 4, mc_filter[1]);
+
+	spin_unlock_irqrestore (&priv->lock, flags);
+
+}//end of rtl8169_set_rx_mode (struct net_device *dev)
+
+
+
+
+
+
+
+//================================================================================
+struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
+
+{
+	struct rtl8169_private *priv = dev->priv;
+
+    return &priv->stats;
+}
+
+
+
+
+
+
+
+
+//================================================================================
+static struct pci_driver rtl8169_pci_driver = {
+	name:		MODULENAME,
+	id_table:	rtl8169_pci_tbl,
+	probe:		rtl8169_init_one,
+	remove:		rtl8169_remove_one,
+	suspend:	NULL,
+	resume:		NULL,
+};
+
+
+
+
+
+//======================================================================================================
+static int __init rtl8169_init_module (void)
+{
+	return pci_module_init (&rtl8169_pci_driver);	// pci_register_driver (drv)
+}
+
+
+
+
+//======================================================================================================
+static void __exit rtl8169_cleanup_module (void)
+{
+	pci_unregister_driver (&rtl8169_pci_driver);
+}
+
+
+#ifdef RTL8169_JUMBO_FRAME_SUPPORT
+static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
+{
+	struct rtl8169_private *priv = dev->priv;
+	unsigned long ioaddr = priv->ioaddr;
+
+	if( new_mtu > MAX_JUMBO_FRAME_MTU ){
+		printk("%s: Error -- new_mtu(%d) > MAX_JUMBO_FRAME_MTU(%d).\n", dev->name, new_mtu, MAX_JUMBO_FRAME_MTU);
+		return -1;
+	}
+
+	dev->mtu = new_mtu;
+
+	priv->curr_mtu_size = new_mtu;
+	priv->tx_pkt_len = new_mtu + ETH_HDR_LEN;
+	priv->rx_pkt_len = new_mtu + ETH_HDR_LEN;
+	priv->hw_rx_pkt_len = priv->rx_pkt_len + 8;
+
+	RTL_W8 ( Cfg9346, Cfg9346_Unlock);
+	RTL_W16	( RxMaxSize, (unsigned short)priv->hw_rx_pkt_len );
+	RTL_W8 ( Cfg9346, Cfg9346_Lock);
+
+	DBG_PRINT("-------------------------- \n");
+	DBG_PRINT("dev->mtu = %d \n", dev->mtu);
+	DBG_PRINT("priv->curr_mtu_size = %d \n", priv->curr_mtu_size);
+	DBG_PRINT("priv->rx_pkt_len = %d \n", priv->rx_pkt_len);
+	DBG_PRINT("priv->tx_pkt_len = %d \n", priv->tx_pkt_len);
+	DBG_PRINT("RTL_W16( RxMaxSize, %d )\n", priv->hw_rx_pkt_len);
+	DBG_PRINT("-------------------------- \n");
+
+	rtl8169_close (dev);
+	rtl8169_open (dev);
+
+	return 0;
+}
+#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT
+
+
+
+
+
+
+
+
+
+
+
+//======================================================================================================
+module_init(rtl8169_init_module);
+  module_exit(rtl8169_cleanup_module);
diff -urN linux-original/drivers/pci/probe.c linux/drivers/pci/probe.c
--- linux-original/drivers/pci/probe.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/pci/probe.c	2005-07-08 08:55:27.000000000 -0400
@@ -551,6 +551,20 @@
 	pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
 	class >>= 8;				    /* upper 3 bytes */
 	dev->class = class;
+#ifdef CONFIG_IOMEGA8241	
+	/*
+	 * The VIA VT6410 used on the Iomega StorCenter Network Hard Drive reports
+	 * with a class of 0x01040 (PCI_CLASS_STORAGE_RAID).
+	 *
+	 * The following correction allows it to be used as a standard PCI IDE
+	 * controller (0x0101)
+	 */
+	if((dev->vendor==PCI_VENDOR_ID_VIA)&&(dev->device==PCI_DEVICE_ID_VIA_6410)) {
+		dev->class=0x01018f;
+		printk("PCI: Adjustments for the VIA VT6410 controller have been made\n");
+	}
+#endif /* CONFIG_IOMEGA8241 */
+
 	class >>= 8;
 
 	pr_debug("PCI: Found %s [%04x/%04x] %06x %02x\n", pci_name(dev),
diff -urN linux-original/drivers/serial/8250.c linux/drivers/serial/8250.c
--- linux-original/drivers/serial/8250.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/drivers/serial/8250.c	2005-07-08 09:02:11.000000000 -0400
@@ -46,6 +46,10 @@
 
 #include "8250.h"
 
+#ifdef CONFIG_IOMEGA8241
+#include <platforms/iomega8241.h>
+#endif /* CONFIG_IOMEGA8241 */
+
 /*
  * Configuration:
  *   share_irqs - whether we pass SA_SHIRQ to request_irq().  This option
@@ -68,7 +72,8 @@
 #define DEBUG_INTR(fmt...)	do { } while (0)
 #endif
 
-#define PASS_LIMIT	256
+//#define PASS_LIMIT	256
+#define PASS_LIMIT	32
 
 /*
  * We default to IRQ0 for the "no irq" hack.   Some
@@ -1543,7 +1548,15 @@
 	 * are set via set_termios(), which will be occurring imminently
 	 * anyway, so we don't enable them here.
 	 */
+#ifdef CONFIG_IOMEGA8241
+	/* We do not enable UART_IER_RLSI because it causes problem
+         * when you send data to the port before you open it. 
+         * -xianghua xiao 2005.7.7
+         */
+	up->ier = UART_IER_RDI;
+#else
 	up->ier = UART_IER_RLSI | UART_IER_RDI;
+#endif /* CONFIG_IOMEGA8241 */
 	serial_outp(up, UART_IER, up->ier);
 
 	if (up->port.flags & UPF_FOURPORT) {
diff -urN linux-original/include/asm-ppc/mpc10x.h linux/include/asm-ppc/mpc10x.h
--- linux-original/include/asm-ppc/mpc10x.h	2005-06-17 15:48:29.000000000 -0400
+++ linux/include/asm-ppc/mpc10x.h	2005-07-08 08:55:27.000000000 -0400
@@ -76,7 +76,11 @@
 
 #define	MPC10X_MAPB_PCI_INTACK_ADDR	0xfef00000
 #define	MPC10X_MAPB_PCI_IO_START	0x00000000
+#ifdef CONFIG_IOMEGA8241
+#define	MPC10X_MAPB_PCI_IO_END	    0xFFFF
+#else
 #define	MPC10X_MAPB_PCI_IO_END	       (0x00c00000 - 1)
+#endif /* CONFIG_IOMEGA8241 */
 #define	MPC10X_MAPB_PCI_MEM_START	0x80000000
 #define	MPC10X_MAPB_PCI_MEM_END	       (0xc0000000 - 1)
 
@@ -157,8 +161,11 @@
  */
 extern unsigned long			ioremap_base;
 #define	MPC10X_MAPA_EUMB_BASE		(ioremap_base - MPC10X_EUMB_SIZE)
+#ifdef CONFIG_IOMEGA8241
+#define	MPC10X_MAPB_EUMB_BASE		0xFDF00000
+#else
 #define	MPC10X_MAPB_EUMB_BASE		MPC10X_MAPA_EUMB_BASE
-
+#endif /* CONFIG_IOMEGA8241 */
 
 int mpc10x_bridge_init(struct pci_controller *hose,
 		       uint current_map,
diff -urN linux-original/include/asm-ppc/serial.h linux/include/asm-ppc/serial.h
--- linux-original/include/asm-ppc/serial.h	2005-06-17 15:48:29.000000000 -0400
+++ linux/include/asm-ppc/serial.h	2005-07-08 08:55:27.000000000 -0400
@@ -40,6 +40,8 @@
 #include <asm/mpc85xx.h>
 #elif defined(CONFIG_RADSTONE_PPC7D)
 #include <platforms/radstone_ppc7d.h>
+#elif defined(CONFIG_IOMEGA8241)
+#include <platforms/iomega8241.h>
 #else
 
 /*
diff -urN linux-original/include/linux/ds1337.h linux/include/linux/ds1337.h
--- linux-original/include/linux/ds1337.h	1969-12-31 19:00:00.000000000 -0500
+++ linux/include/linux/ds1337.h	2005-07-08 08:55:27.000000000 -0400
@@ -0,0 +1,103 @@
+/*
+ *  include/linux/ds1337.h
+ *
+ *  Copyright (C) 2005 USI(Shanghai) Co., Ltd.
+ * 
+ *  Original Ported by Martin. Check and clean up by Sam Song.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#include <asm/time.h>
+#include "i2c_export.h"
+
+typedef struct _rtc_second
+{
+	unsigned char resv:1;
+	unsigned char ten:3;
+	unsigned char one:4;	
+}RTC_SECOND;
+
+typedef struct _rtc_minute
+{
+	unsigned char resv:1;
+	unsigned char ten:3;
+	unsigned char one:4;	
+}RTC_MINUTE;
+
+typedef struct _rtc_hour
+{
+	unsigned char resv:1;
+	unsigned char ampm:1;
+	unsigned char ten1:1;
+	unsigned char ten2:1;
+	unsigned char one:4;	
+}RTC_HOUR;
+
+typedef struct _rtc_day
+{
+	unsigned char resv:5;
+	unsigned char one:3;	
+}RTC_DAY;
+
+typedef struct _rtc_date
+{
+	unsigned char resv:2;
+	unsigned char ten:2;
+	unsigned char one:4;	
+}RTC_DATE;
+
+struct _rtc_month
+{
+	unsigned char century:1;
+	unsigned char resv:2;
+	unsigned char ten:1;
+	unsigned char one:4;	
+};
+
+struct _rtc_year
+{
+	unsigned char ten:4;
+	unsigned char one:4;	
+};
+
+/* we should pay attention to the structure when it is in memory */
+typedef struct _rtc_time
+{
+	RTC_SECOND  second;
+	RTC_MINUTE	minute;
+	RTC_HOUR	hour;
+	RTC_DAY		day;
+	RTC_DATE	date;
+	struct _rtc_month month;
+	struct _rtc_year year;
+}RTC_TIME;
+
+/* next should be some struct for the Alarm register */
+/* but now we don't need to implement it */
+typedef struct _rtc_ctrl
+{
+	unsigned char eosc:1;
+	unsigned char resv:2;
+	unsigned char rs2:1;
+	unsigned char rs1:1;
+	unsigned char intcn:1;
+	unsigned char a2ie:1;
+	unsigned char a1ie:1;	
+}RTC_CTRL;
+
+typedef struct _rtc_sts
+{
+	unsigned char osf:1;
+	unsigned char resv:5;
+	unsigned char a2f:1;
+	unsigned char a1f:1;
+}RTC_STS;
+
+extern long ds1337_init(void);
+extern int ds1337_set_time(unsigned long settime);
+extern unsigned long ds1337_get_time(void);
+void ds1337_usi_set_time(unsigned int year, unsigned int mon, unsigned int day, unsigned int hour, unsigned int min, unsigned int sec);
diff -urN linux-original/include/linux/i2c_export.h linux/include/linux/i2c_export.h
--- linux-original/include/linux/i2c_export.h	1969-12-31 19:00:00.000000000 -0500
+++ linux/include/linux/i2c_export.h	2005-07-08 08:55:27.000000000 -0400
@@ -0,0 +1,179 @@
+/*
+ *  include/linux/i2c_export.h                          
+ *
+ *  Copyright (C) 2005 USI(Shanghai) Co., Ltd.
+ *
+ *  Original Ported by Martin. Check and clean up by Sam Song.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#define I2CADR    0x00003000
+#define I2CFDR    0x00003004
+#define I2CCR     0x00003008
+#define I2CSR     0x0000300C
+#define I2CDR     0x00003010
+
+typedef enum _i2cstatus
+{
+ 	I2CSUCCESS     = 0x3000,
+ 	I2CADDRESS,
+ 	I2CERROR,
+ 	I2CBUFFFULL,
+ 	I2CBUFFEMPTY,
+ 	I2CXMITERROR,
+ 	I2CRCVERROR,
+ 	I2CBUSBUSY,
+ 	I2CALOSS,
+ 	I2CNOEVENT,
+} 	I2CStatus;
+
+/* These are the defined return values for the I2C_do_transaction function.
+ * Any non-zero value indicates failure.  Failure modes can be added for 
+ * more detailed error reporting.
+ */
+typedef enum _i2c_status
+{
+ 	I2C_SUCCESS     = 0,
+ 	I2C_ERROR,
+	}I2C_Status;
+
+typedef enum i2c_control 
+{
+ 	MEN  = 0x00000080,
+ 	MIEN = 0x00000040,
+ 	MSTA = 0x00000020,
+ 	MTX  = 0x00000010,
+ 	TXAK = 0x00000008,
+ 	RSTA = 0x00000004,
+} I2C_CONTROL;
+
+typedef enum i2c_status
+{
+  	MCF   =  0x00000080,
+  	MAAS  =  0x00000040,
+  	MBB   =  0x00000020,
+  	MAL   =  0x00000010,
+  	SRW   =  0x00000004,
+  	MIF   =  0x00000002,
+  	RXAK  =  0x00000001,
+} I2C_STATUS;
+
+typedef struct _i2c_ctrl
+{
+	unsigned int reserved0 : 24;
+	unsigned int men       : 1;
+	unsigned int mien      : 1;
+	unsigned int msta      : 1;
+	unsigned int mtx       : 1;
+	unsigned int txak      : 1;
+	unsigned int rsta      : 1;
+	unsigned int reserved1 : 2;
+} I2C_CTRL;
+
+typedef struct _i2c_stat
+{
+	unsigned int rsrv0    : 24;
+	unsigned int mcf      : 1;
+	unsigned int maas     : 1;
+	unsigned int mbb      : 1;
+	unsigned int mal      : 1;
+	unsigned int rsrv1    : 1;
+	unsigned int srw      : 1;
+	unsigned int mif      : 1;
+	unsigned int rxak     : 1;
+} I2C_STAT;
+
+typedef enum _i2c_mode
+{
+	RCV =  0,
+	XMIT = 1,
+} I2C_MODE;
+
+
+/* These are the defined tasks for I2C_do_transaction.
+ * Modes for SLAVE_RCV and SLAVE_XMIT will be added.
+ */
+typedef enum _i2c_transaction_mode
+{
+	I2C_MASTER_RCV =  0,
+	I2C_MASTER_XMIT = 1,
+} I2C_TRANSACTION_MODE;
+
+typedef enum _i2c_interrupt_mode
+{
+	I2C_INT_DISABLE =  0,
+	I2C_INT_ENABLE = 1,
+} I2C_INTERRUPT_MODE;
+
+typedef enum _i2c_stop
+{
+	I2C_NO_STOP =  0,
+	I2C_STOP = 1,
+} I2C_STOP_MODE;
+
+typedef enum _i2c_restart
+{
+	I2C_NO_RESTART =  0,
+	I2C_RESTART = 1,
+} I2C_RESTART_MODE;
+
+/******************** App. API ********************
+ * The application API is for user level application 
+ * to use the functionality provided by I2C driver.
+ * This is a "generic" I2C interface, it should contain
+ * nothing specific to the Kahlua implementation.
+ * Only the generic functions are exported by the library.
+ * 
+ * Note: Its App.s responsibility to swap the data
+ *       byte. In our API, we just transfer whatever
+ *       we are given
+ **************************************************/
+
+/*  Initialize I2C unit with the following:
+ *  driver's slave address 
+ *  interrupt enabled
+ *  optional pointer to application layer print function
+ *
+ *  These parameters may be added:
+ *  desired clock rate
+ *  digital filter frequency sampling rate
+ *
+ *  This function must be called before I2C unit can be used.
+ */
+extern I2C_Status I2C_Initialize( 
+	unsigned char addr,            /* driver's I2C slave address */
+	I2C_INTERRUPT_MODE en_int,     /* 1 - enable I2C interrupt 
+	                                * 0 - disable I2C interrupt
+	                                */
+    	int (*app_print_function)(char *,...)); 
+	/* pointer to optional "printf"
+         * provided by application
+         */
+
+/* Perform the given I2C transaction, only MASTER_XMIT and MASTER_RCV
+ * are implemented.  Both are only in polling mode.
+ * 
+ * en_int controls interrupt/polling mode
+ * act is the type of transaction
+ * addr is the I2C address of the slave device
+ * len is the length of data to send or receive
+ * buffer is the address of the data buffer
+ * stop = I2C_NO_STOP, don't signal STOP at end of transaction
+ *        I2C_STOP, signal STOP at end of transaction
+ * retry is the timeout retry value, currently ignored
+ * rsta = I2C_NO_RESTART, this is not continuation of existing transaction
+ *        I2C_RESTART, this is a continuation of existing transaction
+ */
+extern I2C_Status I2C_do_transaction( I2C_INTERRUPT_MODE en_int,
+                                      I2C_TRANSACTION_MODE act,
+                                      unsigned char i2c_addr,
+                                      unsigned char data_addr,
+                                      int len,
+                                      char *buffer,
+                                      I2C_STOP_MODE stop,
+                                      int retry,
+                                      I2C_RESTART_MODE rsta);
diff -urN linux-original/include/linux/pci_ids.h linux/include/linux/pci_ids.h
--- linux-original/include/linux/pci_ids.h	2005-06-17 15:48:29.000000000 -0400
+++ linux/include/linux/pci_ids.h	2005-07-08 08:55:27.000000000 -0400
@@ -1396,6 +1396,7 @@
 #define PCI_DEVICE_ID_VIA_8703_51_0	0x3148
 #define PCI_DEVICE_ID_VIA_8237_SATA	0x3149
 #define PCI_DEVICE_ID_VIA_XN266		0x3156
+#define PCI_DEVICE_ID_VIA_6410		0x3164
 #define PCI_DEVICE_ID_VIA_8754C_0	0x3168
 #define PCI_DEVICE_ID_VIA_8235		0x3177
 #define PCI_DEVICE_ID_VIA_P4N333	0x3178