summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/etherrt2860.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-06-06 16:04:24 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-06-06 16:04:24 +0200
commit8243b6600f4c8d60e520aa1b20368ae9575aabf9 (patch)
tree0652c55ab7f685afc378ea94bf9187606fd5c1c6 /sys/src/9/pc/etherrt2860.c
parent3bebd3f5e278d77b1eb526cd9f924b0777043d2b (diff)
pc/ether*: use 64-bit physical addresses and check pci membar types and sizes
Diffstat (limited to 'sys/src/9/pc/etherrt2860.c')
-rw-r--r--sys/src/9/pc/etherrt2860.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/src/9/pc/etherrt2860.c b/sys/src/9/pc/etherrt2860.c
index 696660766..bbebc2bab 100644
--- a/sys/src/9/pc/etherrt2860.c
+++ b/sys/src/9/pc/etherrt2860.c
@@ -925,6 +925,7 @@ struct Ctlr {
QLock;
Ctlr *link;
+ uvlong port;
Pcidev *pdev;
Wifi *wifi;
@@ -967,8 +968,6 @@ struct Ctlr {
u32int txpow40mhz_5ghz[5];
int flags;
-
- int port;
int power;
int active;
int broken;
@@ -3480,6 +3479,8 @@ rt2860pci(void)
continue;
if(pdev->vid != 0x1814) /* Ralink */
continue;
+ if(pdev->mem[0].bar & 1)
+ continue;
switch(pdev->did){
default:
@@ -3494,10 +3495,10 @@ rt2860pci(void)
print("rt2860: unable to alloc Ctlr\n");
continue;
}
- ctlr->port = pdev->mem[0].bar & ~0x0F;
- mem = vmap(pdev->mem[0].bar & ~0x0F, pdev->mem[0].size);
+ ctlr->port = pdev->mem[0].bar & ~0xF;
+ mem = vmap(ctlr->port, pdev->mem[0].size);
if(mem == nil){
- print("rt2860: can't map %8.8luX\n", pdev->mem[0].bar);
+ print("rt2860: can't map %llux\n", ctlr->port);
free(ctlr);
continue;
}