Subversion Repositories Kolibri OS

Rev

Rev 3323 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3323 Rev 3346
Line 478... Line 478...
478
 
478
 
Line 479... Line 479...
479
; Fill in the direct call addresses into the struct
479
; Fill in the direct call addresses into the struct
480
 
480
 
481
        mov     [device.reset], reset
-
 
482
        mov     [device.transmit], null_op
-
 
483
        mov     [device.get_MAC], read_mac
481
        mov     [device.reset], reset
484
        mov     [device.set_MAC], write_mac
482
        mov     [device.transmit], null_op
Line 485... Line 483...
485
        mov     [device.unload], null_op
483
        mov     [device.unload], null_op
Line 827... Line 825...
827
        DEBUGF  1,"Link detect timed-out!\n"
825
        DEBUGF  1,"Link detect timed-out!\n"
828
       @@:
826
       @@:
Line 829... Line 827...
829
 
827
 
830
; print link type
828
; print link type
831
        xor     eax, eax
829
        xor     eax, eax
832
        bsr     ax, word [device.mode]
830
        bsr     ax, word [device.state]
833
        jz      @f
831
        jz      @f
834
        sub     ax, 4
832
        sub     ax, 4
Line 835... Line 833...
835
       @@:
833
       @@:
Line 1106... Line 1104...
1106
        setb    al
1104
        setb    al
Line 1107... Line 1105...
1107
 
1105
 
1108
  .finish:
1106
  .finish:
1109
        test    al, al
1107
        test    al, al
1110
        jz      @f
1108
        jz      @f
1111
        or      byte [device.mode+1], 100b
1109
        or      byte [device.state+1], 100b
1112
       @@:
1110
       @@:
Line 1113... Line 1111...
1113
        ret
1111
        ret
1114
 
1112
 
Line 1217... Line 1215...
1217
        pop     esi
1215
        pop     esi
1218
        and     eax, esi
1216
        and     eax, esi
1219
        and     eax, 1111100000b
1217
        and     eax, 1111100000b
1220
        push    eax
1218
        push    eax
Line 1221... Line 1219...
1221
 
1219
 
Line 1222... Line 1220...
1222
        mov     word[device.mode+2], ax
1220
        mov     word[device.state+2], ax
1223
 
1221
 
1224
; switch to register window 3
1222
; switch to register window 3
1225
        set_io  0
1223
        set_io  0
Line 1506... Line 1504...
1506
        mov     eax, [esp]
1504
        mov     eax, [esp]
Line 1507... Line 1505...
1507
 
1505
 
1508
        mov     cl, al
1506
        mov     cl, al
1509
        inc     cl
1507
        inc     cl
1510
        shl     cl, 3
1508
        shl     cl, 3
Line 1511... Line 1509...
1511
        or      byte [device.mode+1], cl
1509
        or      byte [device.state+1], cl
1512
 
1510
 
1513
        test    al, al ; aui or coax?
1511
        test    al, al ; aui or coax?
1514
        jz      .complete_loopback
1512
        jz      .complete_loopback
Line 1538... Line 1536...
1538
  .aui_finish:
1536
  .aui_finish:
1539
        pop     eax ; al contains the result of operation
1537
        pop     eax ; al contains the result of operation
Line 1540... Line 1538...
1540
 
1538
 
1541
        test    al, al
1539
        test    al, al
1542
        jnz     @f
1540
        jnz     @f
1543
        and     byte [device.mode+1], not 11000b
1541
        and     byte [device.state+1], not 11000b
Line 1544... Line 1542...
1544
       @@:
1542
       @@:
Line 1711... Line 1709...
1711
        jz      @f
1709
        jz      @f
Line 1712... Line 1710...
1712
 
1710
 
1713
        DEBUGF  1,"base TX is available\n"
1711
        DEBUGF  1,"base TX is available\n"
1714
        or      eax, (100b shl 20)
1712
        or      eax, (100b shl 20)
1715
if defined FORCE_FD
1713
if defined FORCE_FD
1716
        mov     word [device.mode], (1 shl 8)
1714
        mov     word [device.state], (1 shl 8)
1717
else
1715
else
1718
        mov     word [device.mode], (1 shl 7)
1716
        mov     word [device.mode], (1 shl 7)
1719
end if
1717
end if
1720
        jmp     .set_media
1718
        jmp     .set_media
Line 1723... Line 1721...
1723
        test    cl, 100b        ; baseFXAvailable
1721
        test    cl, 100b        ; baseFXAvailable
1724
        jz      @f
1722
        jz      @f
Line 1725... Line 1723...
1725
 
1723
 
1726
        DEBUGF  1,"base FX is available\n"
1724
        DEBUGF  1,"base FX is available\n"
1727
        or      eax, (101b shl 20)
1725
        or      eax, (101b shl 20)
1728
        mov     word [device.mode], (1 shl 10)
1726
        mov     word [device.state], (1 shl 10)
1729
        jmp     .set_media
1727
        jmp     .set_media
Line 1730... Line 1728...
1730
       @@:
1728
       @@:
1731
 
1729
 
Line 1732... Line 1730...
1732
        test    cl, 1000000b    ; miiDevice
1730
        test    cl, 1000000b    ; miiDevice
1733
        jz      @f
1731
        jz      @f
1734
 
1732
 
1735
        DEBUGF  1,"mii-device is available\n"
1733
        DEBUGF  1,"mii-device is available\n"
1736
        or      eax, (0110b shl 20)
1734
        or      eax, (0110b shl 20)
Line 1737... Line 1735...
1737
        mov     word [device.mode], (1 shl 13)
1735
        mov     word [device.state], (1 shl 13)
1738
        jmp     .set_media
1736
        jmp     .set_media
Line 1739... Line 1737...
1739
       @@:
1737
       @@:
1740
 
1738
 
1741
        test    cl, 1000b       ; 10bTAvailable
1739
        test    cl, 1000b       ; 10bTAvailable
1742
        jz      @f
1740
        jz      @f
1743
 
1741
 
1744
        DEBUGF  1,"10base-T is available\n"
1742
        DEBUGF  1,"10base-T is available\n"
1745
  .set_default:
1743
  .set_default:
1746
if FORCE_FD
1744
if FORCE_FD
1747
        mov     word [device.mode], (1 shl 6)
1745
        mov     word [device.state], (1 shl 6)
Line 1748... Line 1746...
1748
else
1746
else
Line 1760... Line 1758...
1760
        mov     ax, (10b shl 11) ; EnableDcConverter
1758
        mov     ax, (10b shl 11) ; EnableDcConverter
1761
        out     dx, ax
1759
        out     dx, ax
1762
        pop     eax
1760
        pop     eax
Line 1763... Line 1761...
1763
 
1761
 
1764
        or      eax, (11b shl 20)
1762
        or      eax, (11b shl 20)
1765
        mov     word [device.mode], (1 shl 12)
1763
        mov     word [device.state], (1 shl 12)
1766
        jmp     .set_media
1764
        jmp     .set_media
Line 1767... Line 1765...
1767
       @@:
1765
       @@:
1768
 
1766
 
Line 1769... Line 1767...
1769
        test    cl, 10000b      ; auiAvailable
1767
        test    cl, 10000b      ; auiAvailable
1770
        jz      .set_default
1768
        jz      .set_default
1771
 
1769
 
Line 1772... Line 1770...
1772
        DEBUGF  1,"AUI is available\n"
1770
        DEBUGF  1,"AUI is available\n"
1773
        or      eax, (1 shl 20)
1771
        or      eax, (1 shl 20)
1774
        mov     word [device.mode], (1 shl 11)
1772
        mov     word [device.state], (1 shl 11)
1775
 
1773