Subversion Repositories Kolibri OS

Rev

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

Rev 3201 Rev 3205
Line 55... Line 55...
55
        .tx_wr_des        dd ?  ; Tx current descriptor to write data to
55
        .tx_wr_des        dd ?  ; Tx current descriptor to write data to
56
        .tx_rd_des        dd ?  ; Tx current descriptor to read TX completion
56
        .tx_rd_des        dd ?  ; Tx current descriptor to read TX completion
57
        .rx_crt_des       dd ?  ; Rx current descriptor
57
        .rx_crt_des       dd ?  ; Rx current descriptor
Line 58... Line 58...
58
 
58
 
59
        .io_addr          dd ?
59
        .io_addr          dd ?
60
        .pci_bus          db ?
60
        .pci_bus          dd ?
61
        .pci_dev          db ?
61
        .pci_dev          dd ?
-
 
62
        .irq_line         db ?
Line 62... Line 63...
62
        .irq_line         db ?
63
		rb 3 ; alignment
Line 63... Line 64...
63
 
64
 
Line 382... Line 383...
382
 
383
 
383
;        mov     eax, [IOCTL.input]                     ; get the pci bus and device numbers
384
;        mov     eax, [IOCTL.input]                     ; get the pci bus and device numbers
384
        mov     ax , [eax+1]                            ;
385
        mov     ax , [eax+1]                            ;
385
  .nextdevice:
386
  .nextdevice:
386
        mov     ebx, [esi]
387
        mov     ebx, [esi]
-
 
388
        cmp     al, byte[device.pci_bus]
-
 
389
        jne     @f
387
        cmp     ax , word [device.pci_bus]              ; compare with pci and device num in device list (notice the usage of word instead of byte)
390
        cmp     ah, byte[device.pci_dev]
-
 
391
        je      .find_devicenum                         ; Device is already loaded, let's find it's device number
388
        je      .find_devicenum                         ; Device is already loaded, let's find it's device number
392
       @@:
389
        add     esi, 4
393
        add     esi, 4
Line 390... Line 394...
390
        loop    .nextdevice
394
        loop    .nextdevice
Line 412... Line 416...
412
        mov     [device.name], my_service
416
        mov     [device.name], my_service
Line 413... Line 417...
413
 
417
 
Line 414... Line 418...
414
; save the pci bus and device numbers
418
; save the pci bus and device numbers
415
 
419
 
416
        mov     eax, [IOCTL.input]
420
        mov     eax, [IOCTL.input]
417
        mov     cl, [eax+1]
421
        movzx   ecx, byte[eax+1]
418
        mov     [device.pci_bus], cl
422
        mov     [device.pci_bus], ecx
Line 419... Line 423...
419
        mov     cl, [eax+2]
423
        movzx   ecx, byte[eax+2]
Line 420... Line 424...
420
        mov     [device.pci_dev], cl
424
        mov     [device.pci_dev], ecx
Line 421... Line 425...
421
 
425
 
Line 422... Line 426...
422
; Now, it's time to find the base io addres of the PCI device
426
; Now, it's time to find the base io addres of the PCI device
Line 423... Line 427...
423
 
427
 
424
        find_io [device.pci_bus], [device.pci_dev], [device.io_addr]
428
        PCI_find_io
Line 425... Line 429...
425
 
429
 
Line 523... Line 527...
523
align 4
527
align 4
524
probe:
528
probe:
Line 525... Line 529...
525
 
529
 
Line 526... Line 530...
526
        DEBUGF  2,"Probing dec21x4x device: "
530
        DEBUGF  2,"Probing dec21x4x device: "
Line 527... Line -...
527
 
-
 
528
        make_bus_master [device.pci_bus], [device.pci_dev]
-
 
529
 
531
 
530
        movzx   eax, [device.pci_bus]
532
        PCI_make_bus_master
Line 531... Line 533...
531
        movzx   ecx, [device.pci_dev]
533
 
532
        stdcall PciRead32, eax ,ecx ,0                                ; get device/vendor id
534
        stdcall PciRead32, [device.pci_bus], [device.pci_dev], 0                                ; get device/vendor id
533
        DEBUGF  1,"Vendor id: 0x%x\n", ax
535
        DEBUGF  1,"Vendor id: 0x%x\n", ax
Line 550... Line 552...
550
 
552
 
Line 551... Line 553...
551
  .supported_device2:
553
  .supported_device2:
Line 552... Line -...
552
 
-
 
553
        ; wake up the 21143
-
 
554
 
554
 
555
        movzx   ecx, [device.pci_bus]
555
        ; wake up the 21143
Line 556... Line 556...
556
        movzx   edx, [device.pci_dev]
556
 
557
        xor     eax, eax
557
        xor     eax, eax
558
        stdcall PciWrite32, ecx, edx, 0x40, eax
558
        stdcall PciWrite32, [device.pci_bus], [device.pci_dev], 0x40, eax