Subversion Repositories Kolibri OS

Rev

Rev 10049 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10049 Rev 10065
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2010-2021. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2010-2024. All rights reserved.    ;;
4
;; Distributed under terms of the GNU General Public License       ;;
4
;; Distributed under terms of the GNU General Public License       ;;
5
;;                                                                 ;;
5
;;                                                                 ;;
6
;;  rhine.asm                                                      ;;
6
;;  rhine.asm                                                      ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;  Ethernet driver for KolibriOS                                  ;;
8
;;  Ethernet driver for KolibriOS                                  ;;
Line 598... Line 598...
598
  .nextdevice:
598
  .nextdevice:
599
        mov     ebx, [esi]
599
        mov     ebx, [esi]
600
        cmp     al, byte[ebx + device.pci_bus]
600
        cmp     al, byte[ebx + device.pci_bus]
601
        jne     @f
601
        jne     @f
602
        cmp     ah, byte[ebx + device.pci_dev]
602
        cmp     ah, byte[ebx + device.pci_dev]
603
        je      .find_devicenum                         ; Device is already loaded, let's find it's device number
603
        je      .find_devicenum                         ; Device is already loaded, let's find its device number
604
       @@:
604
       @@:
605
        add     esi, 4
605
        add     esi, 4
606
        loop    .nextdevice
606
        loop    .nextdevice
Line 607... Line 607...
607
 
607
 
608
 
608
 
609
; This device doesn't have its own eth_device structure yet, lets create one
609
; This device doesn't have its own eth_device structure yet, let's create one
610
  .firstdevice:
610
  .firstdevice:
Line 611... Line 611...
611
        cmp     [devices], MAX_DEVICES                  ; First check if the driver can handle one more card
611
        cmp     [devices], MAX_DEVICES                  ; First check if the driver can handle one more card
Line 1531... Line 1531...
1531
        mov     ecx, sizeof.rx_head
1531
        mov     ecx, sizeof.rx_head
1532
        mul     ecx
1532
        mul     ecx
1533
        lea     edi, [ebx + device.rx_ring]
1533
        lea     edi, [ebx + device.rx_ring]
1534
        add     edi, eax
1534
        add     edi, eax
Line 1535... Line 1535...
1535
 
1535
 
1536
; Check it's status
1536
; Check its status
1537
        test    [edi + rx_head.status], RX_SBITS_OWN_BIT
1537
        test    [edi + rx_head.status], RX_SBITS_OWN_BIT
Line 1538... Line 1538...
1538
        jnz     .not_RX
1538
        jnz     .not_RX
Line 1543... Line 1543...
1543
 
1543
 
1544
; get length
1544
; get length
1545
        mov     ecx, [edi + rx_head.status]
1545
        mov     ecx, [edi + rx_head.status]
1546
        and     ecx, RX_SBITS_FRAME_LENGTH
1546
        and     ecx, RX_SBITS_FRAME_LENGTH
1547
        shr     ecx, 16
1547
        shr     ecx, 16
Line 1548... Line 1548...
1548
        sub     ecx, 4                          ; We dont want CRC
1548
        sub     ecx, 4                          ; We don't want CRC
1549
 
1549
 
1550
; Update stats
1550
; Update stats
1551
        add     dword [ebx + device.bytes_rx], ecx
1551
        add     dword [ebx + device.bytes_rx], ecx