|
1 | 1 | /*
|
2 | 2 | * VIA VT6105M Fast Ethernet Controller (Rhine III).
|
3 | 3 | * To do:
|
4 |
| - * cache-line size alignments - done |
5 |
| - * reduce tx interrupts - done |
6 | 4 | * reorganise initialisation/shutdown/reset
|
7 | 5 | * adjust Tx FIFO threshold on underflow - untested
|
8 | 6 | * why does the link status never cause an interrupt?
|
9 | 7 | * use the lproc as a periodic timer for stalls, etc.
|
10 |
| - * checksum offload - done |
11 | 8 | * take non-HW stuff out of descriptor for 64-bit
|
12 | 9 | * cleanliness
|
13 | 10 | * why does the receive buffer alloc have a +3?
|
@@ -286,11 +283,10 @@ enum {
|
286 | 283 | Crcsz = 4,
|
287 | 284 | Bslop = 48,
|
288 | 285 | Rdbsz = ETHERMAXTU+Crcsz+Bslop,
|
| 286 | + Maxus = 1000000, /* Soekris 5501s take a while to reset */ |
289 | 287 |
|
290 | 288 | Nrxstats = 8,
|
291 | 289 | Ntxstats = 9,
|
292 |
| - |
293 |
| - Txcopy = 128, |
294 | 290 | };
|
295 | 291 |
|
296 | 292 | typedef struct Ctlr Ctlr;
|
@@ -978,12 +974,12 @@ vt6105Mmiimicmd(Mii* mii, int pa, int ra, int cmd, int data)
|
978 | 974 | csr16w(ctlr, Miidata, data);
|
979 | 975 | csr8w(ctlr, Miicr, cmd);
|
980 | 976 |
|
981 |
| - for(timeo = 0; timeo < 10000; timeo++){ |
| 977 | + for(timeo = 0; timeo < Maxus; timeo++){ |
982 | 978 | if(!(csr8r(ctlr, Miicr) & cmd))
|
983 | 979 | break;
|
984 | 980 | microdelay(1);
|
985 | 981 | }
|
986 |
| - if(timeo >= 10000) |
| 982 | + if(timeo >= Maxus) |
987 | 983 | return -1;
|
988 | 984 |
|
989 | 985 | if(cmd == Wcmd)
|
@@ -1029,13 +1025,12 @@ vt6105Mdetach(Ctlr* ctlr)
|
1029 | 1025 | */
|
1030 | 1026 | csr16w(ctlr, Cr, Stop);
|
1031 | 1027 | csr16w(ctlr, Cr, Stop|Sfrst);
|
1032 |
| - /* limit used to be 10000, but that wasn't enough for our Soekris 5501s */ |
1033 |
| - for(timeo = 0; timeo < 100000; timeo++){ |
| 1028 | + for(timeo = 0; timeo < Maxus; timeo++){ |
1034 | 1029 | if(!(csr16r(ctlr, Cr) & Sfrst))
|
1035 | 1030 | break;
|
1036 | 1031 | microdelay(1);
|
1037 | 1032 | }
|
1038 |
| - if(timeo >= 1000) |
| 1033 | + if(timeo >= Maxus) |
1039 | 1034 | return -1;
|
1040 | 1035 |
|
1041 | 1036 | return 0;
|
@@ -1064,13 +1059,12 @@ vt6105Mreset(Ctlr* ctlr)
|
1064 | 1059 | */
|
1065 | 1060 | r = csr8r(ctlr, Eecsr);
|
1066 | 1061 | csr8w(ctlr, Eecsr, Autold|r);
|
1067 |
| - /* limit used to be 100, but that wasn't enough for our Soekris 5501s */ |
1068 |
| - for(timeo = 0; timeo < 1000000; timeo++){ |
| 1062 | + for(timeo = 0; timeo < Maxus; timeo++){ |
1069 | 1063 | if(!(csr8r(ctlr, Cr) & Autold))
|
1070 | 1064 | break;
|
1071 | 1065 | microdelay(1);
|
1072 | 1066 | }
|
1073 |
| - if(timeo >= 1000000) |
| 1067 | + if(timeo >= Maxus) |
1074 | 1068 | return -1;
|
1075 | 1069 |
|
1076 | 1070 | for(i = 0; i < Eaddrlen; i++)
|
|
0 commit comments