Subversion Repositories Kolibri OS

Rev

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

Rev 1529 Rev 1553
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 PciRead32, ecx ,edx, PCI_REG_COMMAND
135
	stdcall PciRead16, ecx ,edx, PCI_REG_COMMAND
136
 
-
 
Line 137... Line 136...
137
	or	al, PCI_BIT_MASTER ;or PCI_BIT_PIO
136
 
-
 
137
	or	al, PCI_BIT_MASTER or PCI_BIT_PIO
-
 
138
	and	al, not PCI_BIT_MMIO
-
 
139
 
Line 138... Line 140...
138
;        and     al, not PCI_BIT_MMIO
140
;        or      al, PCI_BIT_MASTER or PCI_BIT_MMIO
Line -... Line 141...
-
 
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
139
	stdcall PciWrite32, ecx, edx, PCI_REG_COMMAND, eax
162
;   mov     ah, [pci_bus]
140
 
163
;   mov     bl, 0x0D                            ;to Lantency Timer Register
141
;; TODO: try to switch to PIO, and check if PIO works or not..
164
;   call    pci_write_reg
142
 
165
   ;******Check latency setting***********
143
}
166
;  .Done:
Line 189... Line 212...
189
	.bytes_tx	dq ?	; Statistics, updated by the driver
212
	.bytes_tx	dq ?	; Statistics, updated by the driver
190
	.bytes_rx	dq ?	;
213
	.bytes_rx	dq ?	;
191
	.packets_tx	dd ?	;
214
	.packets_tx	dd ?	;
192
	.packets_rx	dd ?	;
215
	.packets_rx	dd ?	;
Line -... Line 216...
-
 
216
 
-
 
217
;        .hwcksum        dd ?
193
 
218
 
194
	.end:
219
	.end:
Line 195... Line 220...
195
}
220
}