ref: 282381c5444b614613792ddbdfb3131d8b81f575
parent: 18055ba91b1522dc623a33a7725df8984c8fab64
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Nov 2 15:53:20 EST 2020
mtx: fix pci access routines (see changeset 8012:78891f472fbf)
--- a/sys/src/9/mtx/pcimtx.c
+++ b/sys/src/9/mtx/pcimtx.c
@@ -115,17 +115,13 @@
int
pcicfgrw8(int tbdf, int rno, int data, int read)
{- int o, type, x;
+ int o, x;
- if(BUSBNO(tbdf))
- type = 0x01;
- else
- type = 0x00;
switch(pcicfgmode){case 1:
o = rno & 0x03;
rno &= ~0x03;
- outl(PciADDR, 0x80000000|BUSBDF(tbdf)|rno|type);
+ outl(PciADDR, 0x80000000|BUSBDF(tbdf)|rno);
if(read)
data = inb(PciDATA+o);
else
@@ -151,17 +147,13 @@
int
pcicfgrw16(int tbdf, int rno, int data, int read)
{- int o, type;
+ int o;
- if(BUSBNO(tbdf))
- type = 0x01;
- else
- type = 0x00;
switch(pcicfgmode){case 1:
o = rno & 0x02;
rno &= ~0x03;
- outl(PciADDR, 0x80000000|BUSBDF(tbdf)|rno|type);
+ outl(PciADDR, 0x80000000|BUSBDF(tbdf)|rno);
if(read)
data = ins(PciDATA+o);
else
@@ -186,16 +178,10 @@
int
pcicfgrw32(int tbdf, int rno, int data, int read)
{- int type;
-
- if(BUSBNO(tbdf))
- type = 0x01;
- else
- type = 0x00;
switch(pcicfgmode){case 1:
rno &= ~0x03;
- outl(PciADDR, 0x80000000|BUSBDF(tbdf)|rno|type);
+ outl(PciADDR, 0x80000000|BUSBDF(tbdf)|rno);
if(read)
data = inl(PciDATA);
else
--
⑨