Subversion Repositories Kolibri OS

Rev

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

Rev 1481 Rev 1492
Line 100... Line 100...
100
include 'imports.inc'
100
include 'imports.inc'
101
include 'fdo.inc'
101
include 'fdo.inc'
102
include 'netdrv.inc'
102
include 'netdrv.inc'
Line 103... Line 103...
103
 
103
 
104
 
104
 
105
OS_BASE 	equ 0;
105
OS_BASE 	equ 0
Line 106... Line 106...
106
new_app_base	equ 0x60400000
106
new_app_base	equ 0x60400000
107
PROC_BASE	equ OS_BASE+0x0080000
107
PROC_BASE	equ OS_BASE+0x0080000
108
 
108
 
Line 109... Line -...
109
public START
-
 
110
public service_proc
-
 
111
public version
-
 
112
 
-
 
113
 
-
 
114
struc ETH_DEVICE {
-
 
115
; pointers to procedures
-
 
116
      .unload		dd ?
-
 
117
      .reset		dd ?
-
 
118
      .transmit 	dd ?
109
public START
119
      .set_MAC		dd ?
-
 
120
      .get_MAC		dd ?
-
 
121
      .set_mode 	dd ?
-
 
122
      .get_mode 	dd ?
-
 
123
; status & variables
-
 
124
      .bytes_tx 	dq ?
-
 
-
 
110
public service_proc
125
      .bytes_rx 	dq ?
111
public version
-
 
112
 
126
      .packets_tx	dd ?
113
 
Line 127... Line 114...
127
      .packets_rx	dd ?
114
virtual at ebx
128
      .mode		dd ?  ; This dword contains cable status (10mbit/100mbit, full/half duplex, auto negotiation or not,..)
115
 
129
      .name		dd ?
116
	device:
130
      .mac		dp ?
117
 
Line 150... Line 137...
150
      .dn_list_ptr_cleared	db ?
137
      .dn_list_ptr_cleared	db ?
151
      .self_directed_packet	rb 20
138
      .self_directed_packet	rb 20
Line 152... Line 139...
152
 
139
 
Line 153... Line -...
153
      .size = $ - device
-
 
154
 
-
 
155
}
-
 
156
 
-
 
157
virtual at ebx
140
      .size = $ - device
Line 158... Line 141...
158
  device ETH_DEVICE
141
 
Line 528... Line 511...
528
	mov	[device.pci_bus], cl
511
	mov	[device.pci_bus], cl
529
	mov	cl , [eax+2]
512
	mov	cl , [eax+2]
530
	mov	[device.pci_dev], cl
513
	mov	[device.pci_dev], cl
Line 531... Line 514...
531
 
514
 
532
; Now, it's time to find the base io addres of the PCI device
-
 
533
; TODO: implement check if bus and dev exist on this machine
-
 
Line 534... Line 515...
534
 
515
; Now, it's time to find the base io addres of the PCI device
Line 535... Line 516...
535
 
516
 
Line 536... Line -...
536
	find_io [device.pci_bus], [device.pci_dev], [device.io_addr]
-
 
537
 
-
 
538
; We've found the io address, find IRQ now
517
	find_io [device.pci_bus], [device.pci_dev], [device.io_addr]
539
 
-
 
Line 540... Line 518...
540
	movzx	ecx, [device.pci_bus]
518
 
541
	movzx	edx, [device.pci_dev]
519
; We've found the io address, find IRQ now
Line 542... Line 520...
542
	stdcall PciRead8, ecx ,edx ,0x3c				; 0x3c is the offset where irq can be found
520