Hello, [email protected], le mer. 25 nov. 2026 18:38:18 +0000, a ecrit: > Samuel: agreed about the maintenance load, and I am not proposing this as > the default stack. The part I would eventually like to see upstream is > only the hurdish part -- the arbiter interface and its permission model -- > not the xHCI hardware driver. That one can stay out of tree, or be > replaced by a rump-backed implementation of the same interface.
Yes, that makes sense. > 1. A typed arbiter interface, no more binary framing. > > usb.defs is now the only way to submit transfers. xhci is a libnetfs > translator modelled on pci-arbiter: > > /dev/xhci0/devices text listing of attached devices I don't think we need this? We can just `ls` to get the list of devices. > /dev/xhci0/slotN one node per addressed device Rather call it deviceN? And we will probably want a bus numbering. I'm wondering where to expose these. We have acpi and pci on /servers/ and /servers/bus. It would make sense alongside that we have /servers/bus/usb/<bus>/<device>. And in /dev we would only expose the actual (disk/net/etc.) devices. > The slot is a property of the node, never an argument of an RPC, so a > client holding the port of slot1 cannot name another device. Yes, that's what we want. > On unplug the slot is marked dead in the interrupt handler, pending > transfers return ENODEV at once, and the node leaves the namespace. And we never re-use the slot number, right? > - Is the per-node capability model the right shape for an arbiter that a > rump/NetBSD host driver could implement later? It looks so to me, yes. In my mind, I see the capability as "if I expose this node, I am giving access to this device", or "if I expose this node, I am giving access to this bus", so that one can delegate the management of a device or an entire bus. > A few fields in > usb.defs still carry xHCI encodings: ep_type, comp_code, the log2 > interval and the Protocol Speed ID. That is honest about the current > backend but leaks it into the ABI; I would rather turn them into > USB-neutral transfer types, URB statuses and speed codes now, before > anything depends on them, if that is the direction you prefer. Yes, please. > - Where should the interface itself live: hurd/incubator, or a separate > proposal here first? We can probably add it to the hurd repository, so people can easily get it and contribute. > PROTOCOL.md describes the namespace, the RPCs, the error > conventions and the locking, so it can be reviewed without reading > the driver. Better put the MIG interface information in usb.defs. > - usb.defs uses subsystem 42000. Should it be registered in > hurd/subsystems while the interface is still experimental, or left > unregistered until it settles? We can reserve the number for now. You can for instance submit a patch for the hurd tree that just adds an empty usb.defs with just the subsystem number :) > One finding that may be useful on its own: usbhid can now serve /dev/kbd > (--proto=hurdkbd) for X.Org's native Hurd keyboard backend. But then the Hurd console doesn't have access to it. We'd want to make the Hurd console able to get keyboard events (and expose /dev/kbd for Xorg after that). > Since Mach does not export kd_event, both the console client and > X.Org define it locally; would an exported <device/kd.h> be welcome, > or is the local definition the intended convention? We should probably introduce a proper header, yes. > Remaining limitations: root hub ports only, no external hubs, We need to already think about the interface for these, even if not implemented, to make sure it'll not need changes. Samuel
