Annotation of driverkit/notes/enetErrors, revision 1.1.1.1

1.1       root        1:                        Ethernet error handling
                      2:                        
                      3: Transmit errors
                      4: 
                      5: * All errors: we don't know which buffer caused error, due to the design 
                      6:   of the TE. In all cases we have to dequeue everything and throw them 
                      7:   all away.
                      8:   
                      9: * channel errorInterrupt, busError
                     10:   -- action:
                     11:        reset, dequeue and discard all frames
                     12:         
                     13:   << the rest of these are in etxAddlInt_t >>
                     14:   
                     15: * Late collision
                     16:   -- Disables channel
                     17:   -- action:
                     18:        reset, dequeue and discard all frames
                     19:   
                     20: * underrun
                     21:   -- Disables channel
                     22:   -- action:
                     23:        reset, dequeue and discard all frames
                     24:        
                     25: * No Heart beat
                     26:   -- Only useful for TPE; mask off for thin wire
                     27:   -- Channel not disabled
                     28:   -- action:
                     29:        reset, dequeue and discard all frames;
                     30:         enJam();
                     31:        
                     32: * > 15 retries
                     33:   -- Disables channel
                     34:   -- action:
                     35:        reset, dequeue and discard all frames;
                     36:         enJam();
                     37:                
                     38: Receive errors
                     39: 
                     40: * descriptor chan_status errors
                     41:   * short packet - should never happen
                     42:   * alignment error
                     43:   * CRC error 
                     44:   * collided packet
                     45:   -- Action:
                     46:        drop packet on floor.
                     47:        
                     48: * channel errorInterrupt, busError
                     49:   -- Disables channel (maybe...)
                     50:   -- action:
                     51:        dmaAbort (to be sure);
                     52:        dequeue completed frames and restart;
                     53:        
                     54: * overrun
                     55:   -- Disables channel
                     56:   -- action:
                     57:        dequeue completed frames and restart;
                     58:        
                     59: * CRC error - mask this interrupt; detected in descriptor chan_status
                     60: 
                     61: * Alignment error - mask this interrupt; detected in descriptor user status
                     62: 
                     63: Net Jammed errors
                     64: 
                     65: * detected:
                     66:   -- > 15 retries, s/w retry count exceeded
                     67:   -- No heart beat, s/w retry count exceeded
                     68:   -- timeout on TX interrupt 
                     69:   
                     70: * Action:
                     71:   
                     72: m68k en_jam() {
                     73:        if TPE selected {
                     74:                if link integrity OK
                     75:                        return good;
                     76:                else {
                     77:                        select Thin wire;
                     78:                        enable LoopBack (??);
                     79:                        return error;
                     80:                }
                     81:                        
                     82:        }
                     83:        else (thin wire selected) {     
                     84:                if link integrity of TPE OK {
                     85:                        select TPE;
                     86:                        Enable loopback (??);
                     87:                        return GOOD;
                     88:                }
                     89:                else {
                     90:                        log "Net Jammed" message if we haven't already done so;
                     91:                        set ENF_JAMMED flag;
                     92:                        if_down();
                     93:                        timeout(antijam); // clears ENF_JAMMED flag after 10 
                     94:                                          //   seconds
                     95:                        return error;
                     96:                }
                     97:        }
                     98: }
                     99:   
                    100: m88k enJam() {
                    101: 
                    102:        if (++retry_count < max) 
                    103:                return good;
                    104: 
                    105:        remember current I/F mode (TPE or thin);
                    106:        select TPE;
                    107:        wait some h/w delay for Link Integrity to settle down;
                    108:        if link integrity good {
                    109:                return good;
                    110:        }
                    111:        else if (mode was TPE on entry) {
                    112:                select Thin wire;
                    113:                return good;
                    114:        }
                    115:        
                    116:        /* 
                    117:         * Net down.
                    118:         */
                    119:        dequeue and free all frames;
                    120:        set net_down flag; set timeout to clear it in 10 seconds;
                    121:        if_down();
                    122:        return bad;
                    123: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.