summaryrefslogtreecommitdiff
path: root/sys/src/9
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2023-01-05 05:58:33 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2023-01-05 05:58:33 +0000
commit5bce05b759c695fdd5bc71fe04c00407406e644b (patch)
tree5556ffe9783661e6d5ec8da9a0e53ac1a9801409 /sys/src/9
parent95ea8f77397d2e768cef319bea78fc15ad8496d1 (diff)
devusb: provide usb hub device number instead of address in /dev/usb/ctl
The hub address is only usefull for the host controller driver, while userspace really cares about the device number.
Diffstat (limited to 'sys/src/9')
-rw-r--r--sys/src/9/port/devusb.c3
-rw-r--r--sys/src/9/port/portmkfile2
-rw-r--r--sys/src/9/port/usb.h1
3 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/9/port/devusb.c b/sys/src/9/port/devusb.c
index beb55055c..4c92b105c 100644
--- a/sys/src/9/port/devusb.c
+++ b/sys/src/9/port/devusb.c
@@ -298,7 +298,7 @@ seprintep(char *s, char *se, Ep *ep, int all)
s = seprint(s, se, " samplesz %ld", ep->samplesz);
s = seprint(s, se, " hz %ld", ep->hz);
s = seprint(s, se, " uframes %d", ep->uframes);
- s = seprint(s, se, " hub %d", ep->dev->hub);
+ s = seprint(s, se, " hub %d", ep->dev->hubnb);
s = seprint(s, se, " port %d", ep->dev->port);
s = seprint(s, se, " rootport %d", ep->dev->rootport);
s = seprint(s, se, " addr %d", ep->dev->addr);
@@ -1277,6 +1277,7 @@ epctl(Ep *ep, Chan *c, void *a, long n)
nep->maxpkt = 512;
else if(l != Lowspeed)
nep->maxpkt = 64; /* assume full speed */
+ nep->dev->hubnb = d->nb;
nep->dev->hub = d->addr;
nep->dev->port = atoi(cb->f[2]);
nep->dev->depth = d->depth+1;
diff --git a/sys/src/9/port/portmkfile b/sys/src/9/port/portmkfile
index da078685a..5340a1aa4 100644
--- a/sys/src/9/port/portmkfile
+++ b/sys/src/9/port/portmkfile
@@ -109,7 +109,7 @@ random.$O: /sys/include/libsec.h
devaoe.$O sdaoe.$O: /sys/include/fis.h
sysproc.$O: /sys/include/a.out.h
syscallfmt.$O: /sys/src/libc/9syscall/sys.h
-devusb.$O usbxhci.$O: ../port/usb.h
+devusb.$O usbxhci.$O usbxhcipci.$O: ../port/usb.h
usbxhci.$O usbxhcipci.$O: ../port/usbxhci.h
devether.$O ethersink.$O: ../port/etherif.h ../port/netif.h
wifi.$O: ../port/etherif.h ../port/netif.h ../port/wifi.h /sys/include/libsec.h
diff --git a/sys/src/9/port/usb.h b/sys/src/9/port/usb.h
index e16121b99..8657911e2 100644
--- a/sys/src/9/port/usb.h
+++ b/sys/src/9/port/usb.h
@@ -187,6 +187,7 @@ struct Udev
int ishub; /* hubs can allocate devices */
int isroot; /* is a root hub */
int speed; /* Full/Low/High/Super/No -speed */
+ int hubnb; /* USB device number for the parent hub */
int hub; /* device address for the parent hub */
int port; /* port number in the parent hub */
int addr; /* device address */