diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-11-02 20:53:20 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-11-02 20:53:20 +0100 |
commit | aad55ccc2d1e4004574ce96389ee8e5cd9bb2444 (patch) | |
tree | 1c72df1cc057046de2e184e02c2b2c86592ca04d /sys/src/9 | |
parent | a4c6dc1d3d3a2ef3ec4d4ac49b16ec039c353cd7 (diff) |
mtx: fix pci access routines (see changeset 8012:78891f472fbf)
Diffstat (limited to 'sys/src/9')
-rw-r--r-- | sys/src/9/mtx/pcimtx.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/sys/src/9/mtx/pcimtx.c b/sys/src/9/mtx/pcimtx.c index 02f1f4e9a..a2425d609 100644 --- a/sys/src/9/mtx/pcimtx.c +++ b/sys/src/9/mtx/pcimtx.c @@ -115,17 +115,13 @@ pcicfginit(void) 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 @@ pcicfgrw8(int tbdf, int rno, int data, int read) 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 @@ pcicfgrw16(int tbdf, int rno, int data, int read) 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 |