Subversion Repositories Kolibri OS

Rev

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

Rev 1553 Rev 1554
Line 130... Line 130...
130
 
130
 
Line 131... Line 131...
131
macro make_bus_master bus, dev {
131
macro make_bus_master bus, dev {
132
 
132
 
133
	movzx	ecx, bus
133
	movzx	ecx, bus
Line 134... Line 134...
134
	movzx	edx, dev
134
	movzx	edx, dev
135
	stdcall PciRead16, ecx ,edx, PCI_REG_COMMAND
135
	stdcall PciRead32, ecx ,edx, PCI_REG_COMMAND
-
 
136
 
Line 136... Line 137...
136
 
137
	or	al, PCI_BIT_MASTER ;or PCI_BIT_PIO
137
	or	al, PCI_BIT_MASTER or PCI_BIT_PIO
-
 
138
	and	al, not PCI_BIT_MMIO
-
 
139
 
-
 
Line 140... Line 138...
140
;        or      al, PCI_BIT_MASTER or PCI_BIT_MMIO
138
;        and     al, not PCI_BIT_MMIO
Line 141... Line -...
141
;        and     al, not PCI_BIT_PIO
-
 
142
 
-
 
143
	stdcall PciWrite16, ecx, edx, PCI_REG_COMMAND, eax
-
 
144
 
-
 
145
}
-
 
146
 
-
 
147
 
-
 
148
; .Latency:
-
 
149
   ;*******Get current latency setting************************
-
 
150
;   mov     al, 1                                       ;read a byte
-
 
151
;   mov     bh, [pci_dev]
-
 
152
;   mov     ah, [pci_bus]
-
 
153
;   mov     bl, 0x0D                                ;from Lantency Timer Register
-
 
154
;   call    pci_read_reg
-
 
155
   ;******see if its aat least 64 clocks********
-
 
156
;   cmp      ax,64
-
 
157
;   jge      PCNET_adjust_pci_device_Done
-
 
158
   ;******Set latency to 32 clocks*******
-
 
159
;   mov     cx, 64                              ;value to write
-
 
160
;   mov     bh, [pci_dev]
-
 
161
;   mov     al, 1                               ;write a byte
-
 
162
;   mov     ah, [pci_bus]
139
	stdcall PciWrite32, ecx, edx, PCI_REG_COMMAND, eax
163
;   mov     bl, 0x0D                            ;to Lantency Timer Register
140
 
164
;   call    pci_write_reg
141
;; TODO: try to switch to PIO, and check if PIO works or not..
165
   ;******Check latency setting***********
142
 
166
;  .Done:
143
}
Line 212... Line 189...
212
	.bytes_tx	dq ?	; Statistics, updated by the driver
189
	.bytes_tx	dq ?	; Statistics, updated by the driver
213
	.bytes_rx	dq ?	;
190
	.bytes_rx	dq ?	;
214
	.packets_tx	dd ?	;
191
	.packets_tx	dd ?	;
215
	.packets_rx	dd ?	;
192
	.packets_rx	dd ?	;
Line 216... Line -...
216
 
-
 
217
;        .hwcksum        dd ?
-
 
218
 
193
 
219
	.end:
194
	.end:
Line 220... Line 195...
220
}
195
}