From 6d55f4e33d1d8b8ce0f0ecc54df5aa85169fc293 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 3 Aug 2010 15:21:38 +0000 Subject: [PATCH] RTL8169 driver for NET branch (not tested/debugged yet!) git-svn-id: svn://kolibrios.org@1553 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/drivers/netdrv.inc | 35 ++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/kernel/branches/net/drivers/netdrv.inc b/kernel/branches/net/drivers/netdrv.inc index 2ba7a46f81..12c32cfc66 100644 --- a/kernel/branches/net/drivers/netdrv.inc +++ b/kernel/branches/net/drivers/netdrv.inc @@ -132,16 +132,39 @@ macro make_bus_master bus, dev { movzx ecx, bus movzx edx, dev - stdcall PciRead32, ecx ,edx, PCI_REG_COMMAND + stdcall PciRead16, ecx ,edx, PCI_REG_COMMAND - or al, PCI_BIT_MASTER ;or PCI_BIT_PIO -; and al, not PCI_BIT_MMIO - stdcall PciWrite32, ecx, edx, PCI_REG_COMMAND, eax + or al, PCI_BIT_MASTER or PCI_BIT_PIO + and al, not PCI_BIT_MMIO -;; TODO: try to switch to PIO, and check if PIO works or not.. +; or al, PCI_BIT_MASTER or PCI_BIT_MMIO +; and al, not PCI_BIT_PIO + + stdcall PciWrite16, ecx, edx, PCI_REG_COMMAND, eax } + +; .Latency: + ;*******Get current latency setting************************ +; mov al, 1 ;read a byte +; mov bh, [pci_dev] +; mov ah, [pci_bus] +; mov bl, 0x0D ;from Lantency Timer Register +; call pci_read_reg + ;******see if its aat least 64 clocks******** +; cmp ax,64 +; jge PCNET_adjust_pci_device_Done + ;******Set latency to 32 clocks******* +; mov cx, 64 ;value to write +; mov bh, [pci_dev] +; mov al, 1 ;write a byte +; mov ah, [pci_bus] +; mov bl, 0x0D ;to Lantency Timer Register +; call pci_write_reg + ;******Check latency setting*********** +; .Done: + struc IOCTL { .handle dd ? .io_code dd ? @@ -191,6 +214,8 @@ macro NET_DEVICE { .packets_tx dd ? ; .packets_rx dd ? ; +; .hwcksum dd ? + .end: }