From 61d6d826c779b1b33670e536ecc27bf0845f6107 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sat, 28 Aug 2021 10:40:39 +0000 Subject: [PATCH] Some small bugfixes in unfinished drivers. git-svn-id: svn://kolibrios.org@9160 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/unfinished/agp.asm | 6 +++--- drivers/unfinished/cardbus.asm | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/unfinished/agp.asm b/drivers/unfinished/agp.asm index f568d1639b..162cf20b3b 100644 --- a/drivers/unfinished/agp.asm +++ b/drivers/unfinished/agp.asm @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; simple AGP driver for KolibriOS ;; @@ -121,8 +121,8 @@ proc detect mov [bus], ebx movzx ebx, [eax + PCIDEV.devfn] mov [devfn], ebx - invoke PciRead8, [bus], [devfn], PCI_header00.prog_if - test al, 1 shl 4 ; got capabilities list? + invoke PciRead16, [bus], [devfn], PCI_header00.status + test ax, PCI_STATUS_CAPA ; got capabilities list? jnz .got_capabilities_list ; TODO: Do it the old way: detect device and check with a list of known capabilities diff --git a/drivers/unfinished/cardbus.asm b/drivers/unfinished/cardbus.asm index 3a2abba50b..cc1ba6c116 100644 --- a/drivers/unfinished/cardbus.asm +++ b/drivers/unfinished/cardbus.asm @@ -190,15 +190,15 @@ proc detect ; Enable power - invoke PciRead8, [bus], [devfn], 0x14 ; get capabilities offset - movzx eax, al ; (A0 for TI bridges) + invoke PciRead8, [bus], [devfn], PCI_header02.cap_list_offs ; get capabilities offset + movzx eax, al ; (A0 for TI bridges) DEBUGF 1, "Capabilities offset=0x%x\n", eax:2 - add al, 4 ; Power management control/status - invoke PciWrite16, [bus], [devfn], eax, 0x0100 ; Enable PME signaling, power state=D0 + add al, 4 ; Power management control/status + invoke PciWrite16, [bus], [devfn], eax, 0x0100 ; Enable PME signaling, power state=D0 ; Enable Bus master, io space, memory space - invoke PciWrite16, [bus], [devfn], PCI_header02.command, 0x0007 + invoke PciWrite16, [bus], [devfn], PCI_header02.command, PCI_CMD_PIO or PCI_CMD_MMIO or PCI_CMD_MASTER ; Write CardBus Socket/ExCA base address